繁体   English   中英

不同版本的数据库和SQL Server; 找不到SQL Server

[英]Different versions of database and SQL Server; Couldn't find SQL Server

我目前正在与我的合作伙伴一起进行ASP.NET MVC项目,我们正在使用TFS。 我们俩都在使用VS 2013,但是后来我重新安装了操作系统,并安装了VS 2015社区。 当我从TFS下载该项目时,几乎一切正常,我可以运行该网站,但是当该网站需要访问数据库时(登录时...),就会发生异常。 SQL Server Express 2014已安装在PC上,因此问题可能出在不同版本的数据库和SQL Server或连接字符串中。 但是我该如何解决呢?

第二个屏幕显示: When creating connection to server an error has occured. Server was not found or was not accessible. Check if the name of an instance is correct and if the server is configured to allow remote access. When creating connection to server an error has occured. Server was not found or was not accessible. Check if the name of an instance is correct and if the server is configured to allow remote access.

在此处输入图片说明

在此处输入图片说明

编辑

Web配置中的连接字符串如下所示: <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\\v11.0;AttachDbFilename=|DataDirectory|\\aspnet-Dobrokarty-20141117025208.mdf;Initial Catalog=aspnet-Dobrokarty-20141117025208;Integrated Security=True" providerName="System.Data.SqlClient" />

由于安装了SQL Server 2014 Express,因此应将“(LocalDB)\\ MSSQLLocalDB”用作数据源。

在此处阅读更多信息: https : //msdn.microsoft.com/zh-cn/library/hh510202.aspx?f=255&MSPPError=-2147217396

您的连接字符串应如下所示:

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Dobrokarty-20141117025208.mdf;Initial Catalog=aspnet-Dobrokarty-20141117025208;Integrated Security=True" providerName="System.Data.SqlClient" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM