By default ASPNETDB will be automatically created under App_data directory in your application if personalization is use for the first time.If you wanted to locate ASPNETDB file in your Own Database (SQL Sevrer 2005) then just simply do the following
-Copy the ASPNETDB that is located at the App_data Folder in your Apps and paste it anywhere in your drives.. the after copying
-Remove the ASPNETDB in your App_Data folder
-Open SqlServer 2005 or Studio Management Express
-Right Click on Database Folder then select Attach
-Click Add then Browse the ASPNETDB that you have just copied earlier
-You are done :)
In your WebConfig File point the database "ASPNETDB" that was added in your SQL Sever to create a connection.. See below set up:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source= YOUR SERVER NAME;
Initial Catalog=ASPNET;Integrated Security=True;
MultipleActiveResultSets=False;
Packet Size=4096;
Application Name="
Microsoft SQL Server Management Studio Express""
providerName="System.Data.SqlClient" />
</connectionStrings>
You may also check this article below about Referencing the ASPNETDB Database
Good Luck!
Technorati Tags:
ASP.NET,
SQL