An attempt to attach an auto-named database for file
2008-02-01 17:28
267 查看
问题:
c:/inetpub/wwwroot/Demo/App_Data/aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
附加自动命名的数据库,但失败。已存在同名的数据库,或指定的文件无法打开或位于 UNC 共享目录中。”
解决方案:
Point 1:
Make sure U have Database.mdf file under app_data directory if you are using |DataDirectory| in the Connection String.
Point 2:
string connstring = @"Data Source=./SQLEXPRESS;AttachDbFilename=|DataDirectory|/Database.mdf;Integrated Security=True;User Instance=True";
c:/inetpub/wwwroot/Demo/App_Data/aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
附加自动命名的数据库,但失败。已存在同名的数据库,或指定的文件无法打开或位于 UNC 共享目录中。”
解决方案:
Point 1:
Make sure U have Database.mdf file under app_data directory if you are using |DataDirectory| in the Connection String.
Point 2:
string connstring = @"Data Source=./SQLEXPRESS;AttachDbFilename=|DataDirectory|/Database.mdf;Integrated Security=True;User Instance=True";
相关文章推荐
- An attempt to attach an auto-named database for file
- VS ERROR LNK 1201 ,LINK could not write to the program database (PDB) for the output file
- a universal class to complete import data from an excel file into a database
- Android sqlite attempt to re-open an already-closed object: SQLiteDatabase:
- git push, error: insufficient permission for adding an object to repository database .git/objects
- git push error:error: insufficient permission for adding an object to repository database ./obje
- remote: error: insufficient permission for adding an object to repository database
- git tip: How to undo an uncommitted change/deletion for a specific file in your working directory
- git pull 报错 insufficient permission for adding an object to repository database .git/objects
- ubuntu 下git commit error insufficient permission for adding an object to repository database .git/objects错误 解决方法
- insufficient permission for adding an object to repository database ./objects
- The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
- [已解决]在VMware-server for linux 下装centos错误:an error has occurred. - no valid devices were found on which to create new file system
- How to provision a Domain Controller as File Share Witness for an Exchange 2010 DAG
- error: insufficient permission for adding an object to repository database ./objects
- android SQLiteDatabase attempt to re-open an already-closed object:
- git pull 报错:error: insufficient permission for adding an object to repository database .git/objects
- Could not load file or assembly An attempt was made to load a program with an incorrect format.
- How to attach a resource file to an existing executable file?
- Attach file to database