Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dears
-
finally after hard work , i designed and developed a website and it is working fine on my local server .

i have 2 databases ,one of them is the main database which i create it with sql server 2005 ,
the other one called [ aspnetdb.mdf ] which was implemented internally with VS2008
and it just for membership .

-
Now after i upload a website on a server using FTP , the website working fine but when i browse a page that using [aspnetdb.mdf] data base , the below Error appeared

"
An attempt to attach an auto-named database for file D:\ftp\folder 1 \Domain name \www\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
"


my web.config contain the connection string of the first DB only
-
how i solve this problem .
i try to google this topic but i reach nothing , kindly help me

thanks
Posted

Do not use the aspnetdb.mdf on the hosting server. You can generate the Membership tables inside your main database using the aspnet_regsql command line utility.

http://www.shiningstar.net/ASPNet_Articles/SqlMembershipProvider.aspx[^]
 
Share this answer
 
ASPNETDB.mdf should not be used as membership database on production server.

You should configure your production database to handle the membership data. run aspnet_regsql command on visual studio command prompt and configure the required database.

Secondly,(If you still want to use this only) by default the ASPNETDB.mdf is being accessed using the windows authentication when we access it on development machines. when you put your code on production server this will not work because windows authentication must be disables and sqlserver authetication must be used. you can do that by changing the web.config file, specifically the ConnectionString of the database.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900