473,473 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ConnectionTimeout

BVM
Hi:

Do you know how to change Connection timeout time? By default it's 15s, Now I want to change it to 30s. However SqlConnection.ConnectionTimeout is read only. What should I do?

Also if the SQL query is to long and need several minutes to finish, is there a way to make timeout time longer?

Thanks,

Dennis Huang

Nov 15 '05 #1
3 8152
Dennis, you can change the Connection Timeout property in your Connection
string. Just set tthe value to whatever you want it to be. That will then
change the ConnectionTimeout property on your SqlConnection object.

--
Greg Ewing [MVP]
http://www.citidc.com

"BVM" <De*****@TBH.com.au> wrote in message
news:O$**************@TK2MSFTNGP10.phx.gbl...
Hi:

Do you know how to change Connection timeout time? By default it's 15s, Now
I want to change it to 30s. However SqlConnection.ConnectionTimeout is read
only. What should I do?

Also if the SQL query is to long and need several minutes to finish, is
there a way to make timeout time longer?

Thanks,

Dennis Huang
Nov 15 '05 #2
Hi,

In your case, you should consider setting the CommandTimeout property of the command object instead. ConnectionTimeout is a timeout value for establishing a connection, not executing commands.
BTW, to you can set the connection timeout as a part of the connection string.
For eg: "Database=northwind;server=myServer;Connect Timeout=30;Integrated Security=SSPI"

--
HTH,
Manoj G [.NET MVP]
http://www15.brinkster.com/manoj4dotnet

"BVM" <De*****@TBH.com.au> wrote in message news:O$**************@TK2MSFTNGP10.phx.gbl...
Hi:

Do you know how to change Connection timeout time? By default it's 15s, Now I want to change it to 30s. However SqlConnection.ConnectionTimeout is read only. What should I do?

Also if the SQL query is to long and need several minutes to finish, is there a way to make timeout time longer?

Thanks,

Dennis Huang
Nov 15 '05 #3
And don't set it to zero (ie unlimited). Unfortunately, it currently really means ZERO.

HTH,

--
Greg Low (MVP)
MSDE Manager SQL Tools
www.whitebearconsulting.com

"Manoj G [MVP]" <ma**********@hotmail.com> wrote in message news:uq**************@TK2MSFTNGP10.phx.gbl...
Hi,

In your case, you should consider setting the CommandTimeout property of the command object instead. ConnectionTimeout is a timeout value for establishing a connection, not executing commands.
BTW, to you can set the connection timeout as a part of the connection string.
For eg: "Database=northwind;server=myServer;Connect Timeout=30;Integrated Security=SSPI"

--
HTH,
Manoj G [.NET MVP]
http://www15.brinkster.com/manoj4dotnet

"BVM" <De*****@TBH.com.au> wrote in message news:O$**************@TK2MSFTNGP10.phx.gbl...
Hi:

Do you know how to change Connection timeout time? By default it's 15s, Now I want to change it to 30s. However SqlConnection.ConnectionTimeout is read only. What should I do?

Also if the SQL query is to long and need several minutes to finish, is there a way to make timeout time longer?

Thanks,

Dennis Huang
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John Peter | last post by:
How can i set the Query Processing Time in my asp page. i am getting this error messages "Estimated query processing time 152 exceeds limit 30" John
4
by: Tahir aman | last post by:
I am using ADO to connect to SQL 7.0. At times the connection timeout expires. Is there any way to inrease the default time out? I think currently its 60 secs. Here is the code that I use to...
11
by: David Berry | last post by:
Hi All. I have a SQL Statement on an ASP page that only returns 4 records. When I run it in SQL Server or Query Analyzer it runs in less than a second. When I run it from my ASP page I get: ...
1
by: Tim Meagher | last post by:
I am running ASP code that was migrated from a Windows 2000 Server to a Windows 2003 server. For some reason the connection timeout or command timeout are getting ignored and my query time sout...
3
by: BVM | last post by:
Hi: Do you know how to change Connection timeout time? By default it's 15s, Now I want to change it to 30s. However SqlConnection.ConnectionTimeout is read only. What should I do? Also if the...
0
by: Gill | last post by:
As per documentation "ODBCCOnnection.ConnectionTimeout > Gets or sets the time to wait while trying to establish a connection before > terminating the attempt and generating an error." > > How...
3
by: Piotrek | last post by:
Hi all. I would like to know what is the difference between these two timeouts: - CommandTimeout - ConnectionTimeout I have following setting in my web.config file: <httpRuntime...
8
by: fniles | last post by:
Can I change the connection time out in VB.Net 2003 and MS Access (using OLEDbConnection) ? When I use Connect Timeout = 60 in the connectionstring, I get an error "Multiple-step OLE DB operation...
2
by: cj | last post by:
MySQLConnection.connectiontimeout() returns 15. I want to drop that to 3, but it is read only. I see you can include the timeout "Connection Timeout=30" as part of the connection string but I...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.