Geeks With Blogs

News

Microsoft MVP


DZone MVB


Moderator at CodeASP.NET


Quiz Master







free counters
Free counters
Added on January 19,2012


Follow Me @vmsdurano

A bit About Me



Disclaimer
The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Nor does it represent the opinion of my dog, because I don’t have one.


Vinz' Blog (ProudMonkey) "Code, Beer and Music ~ my way of being a programmer"

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!

Technorati Tags: ,
Posted on Monday, February 23, 2009 4:40 PM ASP.NET , SQL | Back to top


Comments on this post: Adding ASPNETDB.mdf file to SQL Server 2005

# attaching database files are not showing in sql server 2000
Requesting Gravatar...
hi
i need help
Left by mark kate on Mar 13, 2009 4:23 PM

# re: Adding ASPNETDB.mdf file to SQL Server 2005
Requesting Gravatar...
Dear Vinz,

Thanks a lot. You are really help me.

Valeri
Jamaica
Left by Valeri on May 23, 2009 9:51 AM

# Help regarding ASPNETDB.mdf
Requesting Gravatar...
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,

Left by karthikeyan on Aug 23, 2009 11:58 PM

# re: Adding ASPNETDB.mdf file to SQL Server 2005
Requesting Gravatar...
I tried what you said but I faced a probleb when attaching ASPNETDB:

An error occurred when attaching the database(s). Click the hyperlink in the message column for details.

----------

PLZ how to recover this problem?

Left by Algo on Jan 14, 2010 5:51 AM

# re: Adding ASPNETDB.mdf file to SQL Server 2005
Requesting Gravatar...
I dont have ASPNETDB in my App_DATA. im using ASP.net 3.0.
Left by Hadi on Apr 16, 2010 8:49 PM

# re: Adding ASPNETDB.mdf file to SQL Server 2008
Requesting Gravatar...
I have 2 mdf files aspnetdb.mdf & quiz mdf files made in sql server 2005,now i converted my website in c# with vs 2010,but it gives me error on connecting with the mdf files:"database f:\,,\aspnetdb.mdf cannot be upgraded its' non-release version is not supported by this version" and "an attempt to attach auto-named database for file f\,..\aspnetdb.mdf failed","a database with the name exists or is located on UNC server".Please suggest a solution
Left by LOKESH on May 11, 2010 1:33 AM

# re: Adding ASPNETDB.mdf file to SQL Server 2005
Requesting Gravatar...
I will try this. Should the mdf file be set to copy local?
Left by water damage restoration on Aug 21, 2011 11:32 AM

# re: Adding ASPNETDB.mdf file to SQL Server 2005
Requesting Gravatar...
while using this process i am receiving the error message as

An error occured when attaching the database(s). Click the hyperlink in the Message column for details.


Even though i click the hyperlink another error message is showing
Left by vivin on Oct 05, 2011 1:46 AM

comments powered by Disqus

Copyright © Vincent Maverick Durano | Powered by: GeeksWithBlogs.net