更新时间:2022-12-24 10:32:33
默认情况下,SQL Server Express中的远程连接已关闭.
By default Remote connections in SQL Server Express is turned off.
只需打开SQL Express的远程连接,启用TCPIP协议并重新启动服务,检查errorlog是否正在所有网络适配器上进行侦听现在尝试使用客户端PC上的计算机名称(因为它是动态的)进行连接
Just turn on the remote connections for SQL Express, enable TCPIP protocal and restart the service, check errorlog whether it's listening on all network adapters Now try to connect using the machine name (since it's dynamic) from the client pc
这是一个步骤
现在使用sql连接字符串 COMPUTERNAME
例如
now use sql connection string COMPUTERNAME
for E.g
data source=COMPUTERNAME;database=databasename;user id=sa;password=pass;" providerName="System.Data.SqlClient"
另一个参考链接.. http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx
Another reference link ..http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx