Re: Connection Timeout



That explains it perfectly. Many thanks.

"Arild Bakken" <arild.bakken@xxxxxxxxxxxxxxxx> wrote in message
news:%23Cq5Jm2zHHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is include
the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild


.



Relevant Pages


Loading