我在 c# 中有 winform 应用程序,它连接到我自己的数据库,它工作正常我当前的 sql 连接字符串是:
SqlConnection con = new SqlConnection("Data Source=ITPL_PC1;Initial Catalog=Data_Project;Persist Security Info=True;user id=sa;Password=insforia");
但是当我将此winform带到另一台计算机时它无法正常工作..然后我将连接字符串更改为:
SqlConnection con = new SqlConnection("Data Source=192.168.0.28\\ITPL_PC1;Initial Catalog=Data_Project;Persist Security Info=True;user id=sa;Password=insforia");
但它不工作......
我已经更改了远程访问 sql server 中的所有设置,但仍然显示错误
Sql Exception was unhandled
A network-related or instance-specific error occurred while establishing a connection to 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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
我的连接字符串错了吗?它应该是什么?
请帮帮我