Link to home
Start Free TrialLog in
Avatar of FrederikBonte
FrederikBonteFlag for Belgium

asked on

VB.NET and SQL 7 Connection Timeout

I get a Connection Timeout when loading my table into my datagrid. When trying to modify the timeout with modify connection and then changing the value of the connection timeout, it fails again. When comparing the two timeouts it hasn't changed so it isn't saved.

What am i doing wrong? What is the best way to change the limit of the connection timeout, its a big query so it needs much more time. There are over 2 million entry's in my table

Thanks

Frederik
Avatar of trkcorp
trkcorp

I assume ADO...
You are aware that there is a ConnectionTimeout on the connection, obviously, but there is also a CommandTimeout for a command object, and the 2 don't influence one another.  The CommandTimeout can be applied to both the connection and/or a command object.  Now here is some M$ doubletalk:
"The CommandTimeout setting on a Connection object has no effect on the CommandTimeout setting on a Command Object on the same Connection; that is, the Command object's CommandTimeout property does not inherit the value of the Connection object's CommandTimeout value."  
The connection timeout is used on a connection object if: "delays in network traffic or heavy server use make it necessary to abandon a connection attempt.  If the time from the ConnectionTimeout property setting elapses prior to the opening of the connection, an error occurs and ADO cancels the attempt.  If you set the property to zero, ADO will wait indefinitely until the connection is opened.
The ConnectionTimeout property is read/write when the connection is closed and read-only when the connection is open.  On a Connection object, the CommandTimeout property remains read/write after the Connection is opened."
IE; I think you need to use the CommandTimeout rather than the ConnectionTimeout...
Avatar of FrederikBonte

ASKER

Where do I put this CommandTimeOut


I created a connection using the Server Explorer and then took my SQL table and draged it to the form. There I let my SQLAdapter generate a dataset which I connect to my DataGrid.

I don't use ADO, I use OLE for SQL

Thanks Again

Frederik
ASKER CERTIFIED SOLUTION
Avatar of trkcorp
trkcorp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry for the late responds