George2
George2

Reputation: 45761

connection string of ADO.Net of SQL Server

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

Upvotes: 0

Views: 3513

Answers (5)

David Thielen
David Thielen

Reputation: 32864

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.

Upvotes: 0

CodingBarfield
CodingBarfield

Reputation: 3398

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.

Upvotes: 0

samjudson
samjudson

Reputation: 56853

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

Upvotes: 1

Brandon Montgomery
Brandon Montgomery

Reputation: 6986

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

Upvotes: 3

smok1
smok1

Reputation: 2950

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

Upvotes: 2

Related Questions