Connecting Tech Pros Worldwide Forums | Help | Site Map

Connectoon timeout

Newbie
 
Join Date: Oct 2009
Location: india, Delhi
Posts: 4
#1: Oct 15 '09
I am not able to modify the connection timeout time using following connection string
"Provider=SQLOLEDB.1;Persist Security Info=False;PWD=PWD;User ID=UID;Initial Catalog=DB;Data Source=servername;Connect Timeout=60"
or
"Provider=SQLOLEDB.1;Persist Security Info=False;PWD=PWD;User ID=UID;Initial Catalog=DB;Data Source=servername;Connect Timeout=10"

in both the above cases the timeout happens in 30 seconds.
can some one help

Delerna's Avatar
Expert
 
Join Date: Jan 2008
Location: Sydney
Posts: 790
#2: Oct 16 '09

re: Connectoon timeout


Hmm, I have no issue adjusting timeouts but I do it this way
Expand|Select|Wrap|Line Numbers
  1. cnn.Open("Provider=SQLOLEDB.1;Persist Security Info=False;PWD=PWD;User ID=UID;Initial Catalog=DB;Data Source=servername");
  2. cnn.CommandTimeout = 60;
  3.  
Have you done any research on what "ConnectTimeout" actually does?
I have a feeling that it is a timeout for the actual connection creation only.
Or is that what you are trying to do and I have totally missunderstood the question
Newbie
 
Join Date: Oct 2009
Location: india, Delhi
Posts: 4
#3: Oct 16 '09

re: Connectoon timeout


Thanks for msg
The method pointed out by you is also not working I had tries that earlier.
The ConnectTimeout is a property that forces any quarry run on the connection to timeout or terminate if the server does not respond in the given timeout parametere - in this cas 60 secs (for this particualar querry). When u re-send the querry the ConnectTimeout is resetted and times out this querry again if there is no response from server in 60secs.
Regards
Newbie
 
Join Date: Oct 2009
Location: india, Delhi
Posts: 4
#4: Oct 16 '09

re: Connectoon timeout


I may be wrong about the defination I just posted. let me chek and post again
Newbie
 
Join Date: Oct 2009
Location: india, Delhi
Posts: 4
#5: Oct 16 '09

re: Connectoon timeout


you are right
"ConnectTimeout" it is a timeout for the actual connection creation only.
the command for querry timeout is
cnn.CommandTimeout = 60;
This is working fine,
Thanks it was only after ur msg that I could resolve it.
Reply


Similar Microsoft SQL Server bytes