I'm developing an ASP.NET application with Visual Studio 2008 SP1 and C#. I'm also using Sql Server 2008 SP1.
I'm trying to add the tables created with the command aspnet_regsql -S (local) -E -A m
to my own database.
If I run that command it will create a database (Aspnetdb database) with four tables. I want to know if there is a command that creates those tables in my own database (called myDatabase, for example).
And, when the tables are created. How can I connect authentication to myDatabase?
Thank you
will generate in database given by connection string
Also you should configure MembershipProvider to work with your database. Just add this to your web.config
According to the output from "aspnet_regsql -?", there is a paramter -d that you can use, thus making your command:
Alternatively you could call it with the "-sqlexportonly filenamegoes.here" parameter to generate a Sql Script that you can review and then apply to your database:
The MSDN documentation for SqlMembershipProvider explains how to change where it looks for its database, specifically the line connectionStringName="SqlServices" in the Example.
You can specify the
-C <connection string>
option instead of the-S (local)
option and specify a database name in the connection string. This allows to to run the create scripts on an existing database. See here for the aspnet_regsql options.