i tried to run my site using attch db option in my connection and it works fine
now i moved my appliction from Partion G To Partion D and i got the following error:
System.Data.SqlClient.SqlException: Database 'G:\hms 25-11-2012\build 29-12-2012\HMS_Final 30-12-2012\DB\HotelManagementSystem.mdf' already exists. Choose a different database name. Cannot attach the file 'D:\Resources\MyApp\HMS final build\HMS\DB\HotelManagementSystem.mdf'
as database 'HotelManagementSystem'.
tamer el mor...
Member
63 Points
162 Posts
Error Attemping Attach of Sql Db
Dec 31, 2012 07:18 PM|LINK
i tried to run my site using attch db option in my connection and it works fine
now i moved my appliction from Partion G To Partion D and i got the following error:
System.Data.SqlClient.SqlException: Database 'G:\hms 25-11-2012\build 29-12-2012\HMS_Final 30-12-2012\DB\HotelManagementSystem.mdf' already exists. Choose a different database name. Cannot attach the file 'D:\Resources\MyApp\HMS final build\HMS\DB\HotelManagementSystem.mdf' as database 'HotelManagementSystem'.
so any idea ??
i'm using sql 2005 express
Yousef_Jadal...
Star
8812 Points
1502 Posts
Re: Error Attemping Attach of Sql Db
Dec 31, 2012 07:21 PM|LINK
You can't use two databases with the same name, try to change one of them (HotelManagementSystem).
tamer el mor...
Member
63 Points
162 Posts
Re: Error Attemping Attach of Sql Db
Dec 31, 2012 07:29 PM|LINK
I Moved The Application folder from Partion G to Partion D
so i don't have two db
Yousef_Jadal...
Star
8812 Points
1502 Posts
Re: Error Attemping Attach of Sql Db
Dec 31, 2012 07:32 PM|LINK
The message says that there is database exist with the same name, so you need to deatach the existed one.
tamer el mor...
Member
63 Points
162 Posts
Re: Error Attemping Attach of Sql Db
Jan 01, 2013 05:05 AM|LINK
i'm using connection string AttachDbFilename attribute in my config file in order to attach it in run time
I think that sql express has store reference to that db in some where ...
this problem happened a few years ago and i deleted one of sql folder which fix this issue ..but i can't remember which one
Chen Yu - MS...
All-Star
21569 Points
2493 Posts
Microsoft
Re: Error Attemping Attach of Sql Db
Jan 02, 2013 08:20 AM|LINK
Hi,
Do you means you want to delete that SQL Server database file, mdf file and log file? If so, you could find it from below path.
Path: systemdrive:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data\
systemdrive is the drive you install your sql server.
More information :http://technet.microsoft.com/en-us/library/ms143547%28SQL.90%29.aspx
Thanks.
Feedback to us
Develop and promote your apps in Windows Store
vipuldonga
Contributor
3753 Points
692 Posts
Re: Error Attemping Attach of Sql Db
Jan 02, 2013 08:43 AM|LINK
Hi,
can you give my following question amswer..
-> have you already that database in you servar or only move the database to another partion.
Vipul Donga
Mark it as an answer, if it helped
if (MyAnswer)
MarkAsAnswer();
else
Repsonse.Write("correct me where i am wrong");
Chen Yu - MS...
All-Star
21569 Points
2493 Posts
Microsoft
Re: Error Attemping Attach of Sql Db
Jan 08, 2013 01:42 AM|LINK
Hi,
If you have database in your server, you could Restore your database backup; If you want to move the database to another partion, use detach and attach to move your database.
Please start a new thread to ask your question next time. Thanks for your understanding.
Best Regards,
Feedback to us
Develop and promote your apps in Windows Store