0

We have a cluster SQL Server and we use a SRV DNS entry to locate the service (i.e sql.mycompany.com).

MyCompany.com_tcp_http Service Location (SRV) [0][0][1433]sql.Mycompany.com

Now, how I can use the .NET SQLConnection to use this dns name (instead of the server name/IP)? Any ideas?
Should I use System.Net.Dns to translate it first?

4

1 回答 1

0

.NET SQLConnection 不会查找 SRV 记录,只会查找 A 记录。

所以是的,您需要自己使用 System.Net.Dns 查询您的 SRV 记录,解析并在连接字符串中使用结果。

于 2014-10-13T12:11:22.920 回答