小编HAR*_*HNA的帖子

使用Windows身份验证连接到SQL Server

当我尝试使用以下代码连接到SQL Server时:

SqlConnection con = new SqlConnection("Server=localhost,Authentication=Windows Authentication, Database=employeedetails");
con.Open();
SqlCommand cmd;
string s = "delete employee where empid=103";
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确,以及SQL Server是否配置为允许远程连接.(提供程序:SQL网络接口,错误:25 - 连接字符串无效)

c# sql sql-server asp.net

50
推荐指数
3
解决办法
28万
查看次数

标签 统计

asp.net ×1

c# ×1

sql ×1

sql-server ×1