I am fairly new to the login system visual studio comes with and I’ve been wondering if is possible to transfer all the user information created automatically by visual studio from sqlexpress to my own database?, I’ve noticed that ASPNETDB.MDF contains the database information created for users and I wish to use it or store it in my own sqlserver instead of sqlexpress.
Ultimately my goal is to change the following connection string to my own connection string containing the name of my own server and database:
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
Yes, you can do this. The stock ASP.NET membership tables in your SQLEXPRESS database are generated using the
aspnet_regsql.exetool located in%WINDIR%\Microsoft.Net\Framework\(FrameworkVersion). So you should be able to run this tool on your pointing to your new sql server. Then backup and restore the data from the ASPNETDB database (as long as your sqlexpress and sql server versions match). Here is a good overall article about the generation of the membership tables.