无法将 ASP.NET 数据库附加到 SQL Server Management Studio [英] Can't attach ASP.NET database to SQL Server Management Studio
问题描述
我有一个带有数据库的 ASP.NET MVC3 项目.我想将该数据库附加到 SQL Server Management Studio.
I have an ASP.NET MVC3 project that has a database. I want to attach that database to SQL Server Management Studio.
在 SQL Server Management Studio 中,我右键单击 Databases
,然后单击 Attach
,然后单击 Add
并显示文件夹/文件选择对话框.
In SQL Server Management Studio, I right click Databases
, then click Attach
, then click Add
and it shows the folder/file selection dialog.
问题是它不会让我浏览我的用户帐户文件夹 (c:usersBob
) 中的任何文件夹.我可以看到 Bob
文件夹,但没有 +
可以展开,并且没有显示子项(即使我知道我的 Windows 用户文件夹中有文件).为什么不让我去那里探索?
The problem is it won't let me explore any folder inside my user account folder (c:usersBob
). I can see the Bob
folder but there is no +
to expand, and shows no child items (even though I know there are files in my windows user folder). Why isn't it letting me explore there?
SQL Server Management Studio 版本为 11.0.21 (SQL Server 2012)
SQL Server Management Studio is version 11.0.21 (SQL Server 2012)
我尝试从过滤器下拉列表中选择 All files
而不是 *.mdf
,但没有显示文件.
I have tried selecting All files
from the filter dropdown instead of *.mdf
, but no files show.
推荐答案
另外两点需要注意:
- 'attach' 在默认的 'DATA' 目录中查找为服务器配置如下所示.
- 您可能有也可能没有 *.ldf 文件.当您尝试连接时,SSMS 认为你有一个,所以如果你没有,你将不得不点击在要附加的文件列表中删除"该文件.
这篇关于无法将 ASP.NET 数据库附加到 SQL Server Management Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!