4

Is it possible to call (the equivalent of) aspnet_regsql.exe from managed code? My idea is to create a class to automagically build the database for an installed web app, which uses the ASP.NET Membership provider. I could probably call aspnet_regsql.exe direct from code, but I came across the RegSql class(http://msdn.microsoft.com/en-us/library/ms229567.aspx) - unfortunately it doesn't seem to have any methods...

Thanks in advance.

1 Answer 1

4

The RegSql class lives inside aspnet_regsql.exe. It's the entry point for the console application, so it has a static Main(string[]) method.

Following the usage instructions for aspnet_regsql we can pass it the parameters it expects. (something like "-S localhost -U user -P password"). Input parameters are split by a space (' ').

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for that. I missed the Main method. Input parameters can also be in a string array (new string[] { "-S", "localhost", ...})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.