The default is indeed 15 seconds, but unfortunately the value specified is
"at least 15 seconds", not "at most".
This is what I mean:
while not connected{
check timeout, if greater than 15 seconds timeout.
try to connect ->this can call win32 api calls that do not have
timeouts.
}
We guarantee that we will continue trying for at least 15 seconds, but we
are not able to guarantee that we will timeout in 15 seconds. Worst case
scenario is 14 seconds + time it takes the api call to return, I have seen
up to 45 seconds "extra". Sorry.
There is a way to enforce "at most" scenarios, use threads. This is an
advanced scenario since ado.net is not thread safe, but I have seen a few
examples where this is working very well.
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
Tap said:
Hechmi,
The ConnectionTimeout property should work. The default should be 15 seconds and not 30 seconds.
Here are some key statements from the Help
connection before terminating the attempt and generating an error.
Property Value
The time (in seconds) to wait for a connection to open. The default value is 15 seconds.
Remarks
A value of 0 indicates no limit, and should be avoided in a
ConnectionString because an attempt to connect will wait indefinitely.