467,880 Members | 1,117 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,880 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.

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
  • viewed: 12330
Share:
1 Reply
"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.

Similar topics

11 posts views Thread by Andrew Thompson | last post: by
1 post views Thread by Sluggoman | last post: by
4 posts views Thread by PiotrKolodziej | last post: by
reply views Thread by casper | last post: by
2 posts views Thread by shuisheng | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.