2

I added new database file in my solution's app_data folder in VS2008.

But when I tried to expand it from Server Explorer, I get this error

An attempt to attach an auto-named database for file .... failed.

Find the screen shot of the error which occurred in vs2008 IDE.

enter image description here

Can anyone tell me what the problem is?

And how to solve it

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
MARKAND Bhatt
  • 2,428
  • 10
  • 47
  • 80
  • The error is pretty clear - as is says: either you **already** have a database of the same name in your SQL Server Exprses instance; or the **file** cannot be accessed. Check to see if you have such a database already - if not, check to make sure the files are there and accessible – marc_s Nov 29 '12 at 09:29
  • There is surely no database file with the same name. Secondly, i right click on App_Data folder to add new database file(.mdb), but i failed and error comes "The file **** is on network path that is not supported for database files". – MARKAND Bhatt Nov 29 '12 at 09:36
  • sorry .mdf sqlserver express file – MARKAND Bhatt Nov 29 '12 at 10:57

1 Answers1

1

The error is clear in that dialog box, the file you are trying to attach is on a UNC share (any file path beginning with \\ is a UNC path), which is not supported. You need to move the file to the server you are trying to attach it to and reference it by it's local file name, such as S:\SQLdata\TimeCard.mdf

steoleary
  • 8,968
  • 2
  • 33
  • 47