Click here to Skip to main content
11,647,748 members (68,697 online)
Rate this: bad
Please Sign up or sign in to vote.
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 15-Jul-12 12:19pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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 sqlserverautheticationmust be used. you can do that by changing theweb.config file, specifically the ConnectionStringof the database.

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

  Print Answers RSS
0 500
1 F-ES Sitecore 410
2 OriginalGriff 322
3 DamithSL 315
4 CPallini 250
0 OriginalGriff 1,342
1 994
2 DamithSL 971
3 Sergey Alexandrovich Kryukov 873
4 CPallini 795

Advertise | Privacy | Mobile
Web01 | 2.8.150804.3 | Last Updated 16 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100