Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 occured in vs2008 IDE.

http://www.eggheadcafe.com/FileUpload/1619491694/Errordb.jpg[^]

What exactly the issue is?
And how to solve this
Posted

1 solution

Keep the database file in deployment folder.
or else
In you connection string just add the 'database=<database name="">'. This prevents SQL server to create the auto-named database.
 
Share this answer
 
Comments
markand911 29-Nov-12 4:41am    
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". AS i am not allowed to make database, how can i put that file in deployment folder

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900