每次使用 Visual Studio 2012 Ultimate 创建新的依赖关系图时,我都会收到此错误:
Unable to connect to the specified database.
An exception occurred attempting to connect to a database using the following connection string:
Data Source=(LocalDB)\v11.0;AttachDbFilename=;Initial Catalog=master;
Integrated Security=True;Enlist=False;
Asynchronous Processing=True;MultipleActiveResultSets=True;Connect Timeout=30.
Check that the specified SQL Server instance exists and the service is running.
我的解决方案得到正确构建,我的连接字符串是这样的:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=JewelryStore;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
</connectionStrings>
这里有什么问题?
您的问题可能是您的 localDB 实例存在问题:
%localappdata%\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0
我遇到了同样的问题,因为当我安装 VS12 时,我的计算机不在域中,而我最近将其加入到域中,并且我的用户帐户没有 SQL DB 的权限。
为了解决我运行的问题
sqllocaldb stop "v11.0" -k
sqllocaldb delete "v11.0"
sqllocaldb create "v11.0"
sqllocaldb start "v11.0"
然后我重新启动 VS 2012,我的本地数据库现在可以使用,并且依赖关系图现已创建
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)