简体   繁体   English

无法连接到Visual Studio中的SQL Server

[英]Unable to connect to SQL Server in Visual Studio

I tried to make a mail service with connection to the SQL Server, when I reached 当我到达时,我尝试建立一个与SQL Server连接的邮件服务

 con.open(); //where con is the sqlconnection string

It said: 它说:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. 建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 The server was not found or was not accessible. 服务器未找到或无法访问。 Verify that the instance name is correct and that SQL Server is configured to allow remote connections. 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (提供者:SQL网络接口,错误:26-指定服务器/实例时出错)

I tried to enable tcp/ip, checked all services and it were enabled! 我试图启用tcp / ip,检查了所有服务,然后启用了它! and even I gave permissions to own user (me). 甚至我授予自己的用户(我)权限。 Still it didn't work! 仍然没有用!

What can I do now ? 我现在能做什么 ?

I am solving that problem by opening Services then start running SQL Server (SqlExpress) service. 我通过打开服务来解决该问题,然后开始运行SQL Server(SqlExpress)服务。

在此处输入图片说明

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

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