Vinz' Blog

"Code, Beer and Music" ~ my way of being a programmer!
posts - 124, comments - 367, trackbacks - 0

My Links

News

Archives

Image Galleries

Adding ASPNETDB.mdf file to SQL Server 2005

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=&quot;Microsoft SQL Server Management Studio Express&quot;"

          providerName="System.Data.SqlClient" />

</connectionStrings>


You may also check this article below about Referencing the ASPNETDB Database

Good Luck!

Print | posted on Monday, February 23, 2009 4:40 PM |

Feedback

Gravatar

# attaching database files are not showing in sql server 2000

hi
i need help
3/13/2009 4:23 PM | mark kate
Gravatar

# re: Adding ASPNETDB.mdf file to SQL Server 2005

Dear Vinz,

Thanks a lot. You are really help me.

Valeri
Jamaica
5/23/2009 9:51 AM | Valeri
Gravatar

# Help regarding ASPNETDB.mdf

i have create a application that i want to make relationship with my existing table (username field) with default ASPNETDB.mdf username field.

Is that Possoble.can u suggest the ways to do that,thnk you,

8/23/2009 11:58 PM | karthikeyan
Gravatar

# re: Adding ASPNETDB.mdf file to SQL Server 2005

@karthikeyan,

You can add your own Table in the ASPNETDB file and store the additional information there. just be sure to add/link the ApplicationId and the UserId to your Table so that you can map the data based from a particular user and application.

Also try to give this thread a read:http://forums.asp.net/t/1415973.aspx
8/24/2009 12:58 PM | Vinz
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: