Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
174 views
in Technique[技术] by (71.8m points)

c# - connection string to a SQL Server cluster

Could anyone point me or tell me how to write connection string to a SQL Server cluster instance?

I want to establish trusted connection to a database (initial catalog) of the specific instance of a SQL Server cluster. I find for quite some time but can not find official answer from Google.

I am asking for the connection string for C# ADO.Net code.

I know how to write connection string to a normal one-machine non-cluster SQL Server instance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The connection string is written in the usual way; but in clustering you have 3 (or more) addresses: one for each node which constitues the cluster and one for the cluster. E.g.: we have two node with addresses 192.168.0.10 and 192.168.0.20: if you write down one of this numbers as the DataSource in the connection string, you'll gain access to that physical instance. But if you want to access the cluster (virtual) Sql Server instance, you'll have to use the cluster's address (e.g.: 192.168.0.230) as the DataSource. Of course, you can also use the machines' names instead of the IP addresses, provided you are in the same domain as the cluster.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...