时间:2021-07-01 10:21:17 帮助过:2人阅读
保存后运行。出现如下错误:
SocketException: 使用了与请求的协议不兼容的地址。
System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy)
System.Net.Sockets.Socket+Worker.Connect ()
Rethrow as TdsInternalException: Server does not exist or connection refused.
Mono.Data.Tds.Protocol.TdsComm..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion)
Mono.Data.Tds.Protocol.Tds..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion)
Mono.Data.Tds.Protocol.Tds70..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion version)
Mono.Data.Tds.Protocol.Tds80..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout)
Mono.Data.Tds.Protocol.TdsConnectionPoolManager.CreateConnection (Mono.Data.Tds.Protocol.TdsConnectionInfo info)
Mono.Data.Tds.Protocol.TdsConnectionPool.GetConnection ()
System.Data.SqlClient.SqlConnection.Open ()
Rethrow as SqlException: Server does not exist or connection refused.
System.Data.SqlClient.SqlConnection.Open ()
(wrapper remoting-invoke-with-check) System.Data.SqlClient.SqlConnection:Open ()
Testaa.Do () (at Assets/Testaa.cs:17)
Testaa.Start () (at Assets/Testaa.cs:13)
解决方法:将主机名改为主机的IP地址即可。
Unity3d连接SQL Server数据库出现SocketException: 使用了与请求的协议不兼容的地址错误
标签: