[英]Unable to connect to SQL Server on Windows 10 and using Visual Studio 2017
I am using Windows 10 and Visual Studio 2017. I am trying to connect to a database in SQL Server 2014. 我正在使用Windows 10和Visual Studio2017。我正在尝试连接到SQL Server 2014中的数据库。
Visual Studio does pick up the database as shown in the screenshot here: Visual Studio确实会选择数据库,如以下屏幕截图所示:
The connection string is as follows: 连接字符串如下:
The code is: 代码是:
const string connString = "Data Source=CLEAVEN\\SQLEXPRESS;Initial Catalog=EduAssistR;Integrated Security=True";
But I still get error 26 in the browser: 但是我仍然在浏览器中收到错误26:
I've restarted the SQL Server Browser and enable TCP and Remote connections but I still get the error. 我已经重新启动了SQL Server浏览器并启用了TCP和远程连接,但是仍然出现错误。
If I use CLEAVEN\\SQLEXPRESS
instead of CLEAVEN\\\\SQLEXPRESS
, I get this error: 如果我使用
CLEAVEN\\SQLEXPRESS
而不是CLEAVEN\\\\SQLEXPRESS
, CLEAVEN\\\\SQLEXPRESS
此错误:
What could be wrong? 有什么事吗
Thank you in advance. 先感谢您。
I found what was wrong. 我发现出了什么问题。
Silly silly mistake. 愚蠢的愚蠢的错误。
In the Web.config 在Web.config中
I did not change my connection string. 我没有更改连接字符串。 Once I changed it there, all was solved.
一旦我在那里更改,一切都解决了。
Thank you to everyone 谢谢大家
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.