0

I am confused about the connection string format of ADO.Net when connect to a non-default instance of SQL Cluster. I did search but find various samples, could anyone let me know what is the correct format please (if I know the virtual server name and instance name)? I am using trusted connection.

thanks in advance, George

5 Answers 5

3

See http://www.connectionstrings.com/ - great site for making DB connection strings.

Sign up to request clarification or add additional context in comments.

1 Comment

No samples for connection string format for SQL cluster non-default instance. :-(
2

ServerName\InstanceName ? Use double \ when handling strings in C#

7 Comments

I did not find any official documents covering the connection string format for SQL cluster non-default instance. Do you have any referred documents?
I have passed MCTS on Sql Server, so I had to learn ;-), dont remeber exactly when I learned it. I thinh MSDN has some interesting section regarding sql server connnection strings, but I usually takes me some time to find it. Someone posted good reference to web site about connection strings here
Thanks all the same, appreciated if you could post your findings when you find samples for connection string format of SQL cluster non-default instance. I also searched in MSDN, but finding nothing.
@George2: yes, this is how it should be.
|
1

The following web site gives many different connection strings for you. The following should work I believe:

http://www.connectionstrings.com/sql-server-2005#1

This is also a duplicate of connection string to a SQL Server cluster

4 Comments

I did not find official answer from the links you provided. :-)
To quote: "Use serverName\instanceName as Data Source"
I want to confirm with you that for non-default instance, the connection string to SQL Cluster should be -- virtualservername\instancename, and connection string to default instance should be virtualservername?
Can't you just try it and see if it works - surely that would be quicker than waiting for my reply. I connect to a machine on a cluster here with that format so it should work for you.
0

If you can connect to it using visual studio the connection properties should give you the connectionstring vs.net uses. Using that connectionstring might help.

Comments

0

If you want a quick & easy way to try different connection strings, I suggest DatabaseTester (disclaimer - I wrote it). It's free and a very easy way to test. And I agree with the other posts above, for figuring out connections strings ConnectionStrings.com is your best friend.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.