当我尝试使用以下代码连接到 SQLServer 时:
SqlConnection con = new SqlConnection("Server=localhost,Authentication=Windows Authentication, Database=employeedetails");
con.Open();
SqlCommand cmd;
string s = "delete employee where empid=103";
我得到以下错误:
建立到 SQLServer 的连接时发生了与网络相关或实例特定的错误。找不到或无法访问服务器。验证实例名称是否正确,SQLServer 是否配置为允许远程连接。(提供程序: SQL 网络接口,错误: 25-连接字符串无效)