SQL Connection Timeout

G

Guest

I have a PocketPC application written in VB.net which is having difficutly
with the SQLConnection.Open command. When there was a problem with network
connection, it can take the command in excess of 60 seconds to return an
exception to tell me it can't find the SQL server. I have tried setting the
Connection timeout to 0, 1, 2, 10, etc seconds, and none of them seem to make
any difference.

Does anyone know a way to shorten the time it SQLConnection.Open will try to
connect, or to force it to end early? The application running is
time-critical and any conenction that locks up acticity beyond 5 seconds is
to long.
Thank you in advance for any suggestions.

Ä°lker TUNCA
 
P

Paul G. Tobey [eMVP]

Don't open the connection from the user interface thread, then. Fork off
another thread and open the connection from there. If it succeeds, use
Control.Invoke to call back into the UI to notify the user. If it succeeds,
something similar could work in that case, also.

Also, if you search for "SQLConnection time out" in Google Groups of this
group, you get a managable number of results. It might help to read those
threads...

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top