Solved

VB.NET and SQL 7 Connection Timeout

Posted on 2002-05-14
5
343 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:FrederikBonte
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:trkcorp
ID: 7009534
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."
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 7009580
IE; I think you need to use the CommandTimeout rather than the ConnectionTimeout...
0
 

Author Comment

by:FrederikBonte
ID: 7010331
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
0
 
LVL 4

Accepted Solution

by:
trkcorp earned 100 total points
ID: 7011203
Well then, it might help if you were to post the code that handles the connection and database access. In short; you would want to adjust any time out prior to any open.
0
 

Author Comment

by:FrederikBonte
ID: 7258826
sorry for the late responds
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Passing a Text Box name to a Sub 6 96
Firemonkey android show image from resource ? 1 42
VB6 - Scroll Mouse wheel on Picturebox 13 44
DBCtrlGrid, Delphi, Scroll 7 14
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question