473,467 Members | 1,964 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 17 '05 #1
3 2281
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 17 '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 17 '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 17 '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...
12
by: JSheble | last post by:
I've written a Windows Service using C#, but I cannot seem to figure out how to cancel or prevent the service from starting under certain conditions. For example, in the OnStart I read in some...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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: 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: 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 ...

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.