更新时间:2023-02-22 14:45:15
- 检查是否有tcp / ip已启用服务器实例
- 检查防火墙
- 使用网络工具(如网络监视器)捕获tcp或ip级别的连接失败
- 此连接字符串在特殊情况 [ ^ ],你应该使用一般连接字符串语法 [ ^ ]
(PS:从不使用SA将应用程序连接到服务器!您位于域中,甚至可以将AD组添加为SQL Server的用户,因此使用可信连接。 )
hi
i use this code for connect to the SQL Server in my domain network
<add name="Database">
connectionString="server=192.168.0.13,1433;Network Library=DBMSSOCN;Initial Catalog=RayanehSanatPB;User ID=sa;Password=123456;"
providerName="System.Data.SqlClient" />
i have one sql server 2008 and my database are here
i want to all client use this sal database
but the application just running in the local machine that running SQl server
i cant conet to the sql server from another pc in my LAN
please help me
- Check if tcp/ip is enabled for the server instance
- Check firewall
- Use a network tool (like Network Monitor) to catch the connection failure on tcp or ip level
- This connection string is useful in special cases[^], you should use the general connection string syntax[^]
(PS: never use SA to connect an application to the server! You are in a domain and you can add even AD groups as users to SQL server, thus use trusted connection. )