我决定将数据库文件复制到我的项目目录,并根据instruction用作LocalDB。
我已停止服务器并复制了mdf和ldf文件。
现在我试图在MS SQL Management Studio中附加数据库文件。得到错误:
An error occurred when attaching the database(s). Click the hyperlink in the Message column for details.
超链接信息:
Unable to open the physical file "D:\C#nonsens\learncsharp\Data access\LearnCSharp.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
如何查找错误并修复它? DB附加可能有什么问题?