Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need SQL 2008 Connection String Help 2

Status
Not open for further replies.

whateveragain

Programmer
Apr 20, 2009
92
US
I have been trying to get my connection string going for a couple of days and am getting nowhere. The following is my info. Can someone help me put together the proper connectionstring for SQL 2008 Server? I already tried to no avail.

server type: Database Engine
Server name: MyComputer-PC
Authentication: Windows Authentication

local connection
SQL 2008 Server

I want to include the statement: Connect Timeout=30
Thanks
 
What provider are you using?

Adding...
Code:
;Connect Timeout=60
...to the end of your current connection string should update the connection timeout but this won't affect the query/command timeout, (i.e., with the .net framework the SqlCommand.CommandTimeout property defaults to 30 seconds and would also need to be set appropriately if you want to extend the timeout length).

MSDN

Rhys

"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
Terry Pratchett
 
Code:
Data Source=servername;
Initial Catalog=defauldatabase;
Provider=SQLNCLI10;
Integrated Security=SSPI;
Auto Translate=false;
Connect Timeout=30


I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
I'm a newbie. When you say provider, do you mean something like 'MSSQLSERVER'?
 
As per Dhulberts code...
Code:
Data Source=servername;
Initial Catalog=defauldatabase;
[b]Provider=SQLNCLI10;[/b]
Integrated Security=SSPI;
Auto Translate=false;
Connect Timeout=30

Rhys

"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
Terry Pratchett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top