By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,645 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,645 IT Pros & Developers. It's quick & easy.

System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file "Location" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

P: n/a
System.Data.SqlClient.SqlException: An attempt to attach an auto-
named database for file "Location" failed. A database with the same
name exists, or specified file cannot be opened, or it is located on
UNC share.

I am getting the above the exception while connecting to the db and i
have written a web-service...
i.e. a webmethod.

What do I do? Why am i getting this error ? How can i remove this
error so i can start coding.....

Apr 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"weird0" <am********@gmail.comwrote in message
news:11**********************@b58g2000hsg.googlegr oups.com...
System.Data.SqlClient.SqlException: An attempt to attach an auto-
named database for file "Location" failed. A database with the same
name exists, or specified file cannot be opened, or it is located on
UNC share.

I am getting the above the exception while connecting to the db and i
have written a web-service...
i.e. a webmethod.
It's a problem in your connection string. You are probably using Sql
Server Express in the "user instance" mode, and something is wrong in the
parameters that you are providing in the connectionstring. For instance,
your attachdbfilename parameter may be pointing to a file that doesn't
exist, or that is not accessible to the user identity that is executing the
web service.
Apr 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.