473,472 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Timeout on "DataAdapter.Fill"

Hi all

I have a timout problem when I call "DataAdapter.Fill".
When I debug, I see that all timeout settings are correct,
ConnectionTimeout is 0 and also CommandTimeout is 0.

But when I call the fill method I get:
"Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding."} System.Exception
{System.Data.SqlClient.SqlException}

Here is what I do:
Conn.ConnectionString = "Data Source=ServerXY;Initial Catalog=master;Connect
Timeout=0;Integrated Security=SSPI;"
Command.CommandTimeout = 0
System.Data.SqlClient.SqlDataAdapter local_DataAdapter = new
System.Data.SqlClient.SqlDataAdapter(Query, Conn);
System.Data.DataSet local_DataSet = new System.Data.DataSet();
local_DataAdapter.Fill(local_DataSet, DataSetTableName);

Thanks for any comments !!

Regards
Frank
Oct 15 '07 #1
2 35317
"Frank Uray" <Fr*******@discussions.microsoft.comwrote in message
news:91**********************************@microsof t.com...
I have a timout problem when I call "DataAdapter.Fill".
When I debug, I see that all timeout settings are correct,
ConnectionTimeout is 0 and also CommandTimeout is 0.

But when I call the fill method I get:
"Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding."}
One case where this happens is if you are opening connections but not
closing them. Every time this happens, a connection is consumed, and when
you reach the configured maximum (typically 100), the next time that you
attempt to open a connection the system waits for one of the open
connections to be freed. Since this doesn't hapen, you finally get a timeout
error. The problem is that the faulty code is somewhere else (in the part of
the program that is opening and not closing the connections), and not in the
piece of code that displays the error, so it's difficult to debug.

Oct 15 '07 #2
I have found the problem:
On The DataAdapter there is also a CommandTimeout within
SelectCommand. This has to be set also ...

System.Data.SqlClient.SqlDataAdapter local_DataAdapter = new
System.Data.SqlClient.SqlDataAdapter(Query, return_SQLNATIVEConnection);
System.Data.DataSet local_DataSet = new System.Data.DataSet();
local_DataAdapter.SelectCommand.CommandTimeout = 0;
local_DataAdapter.Fill(local_DataSet, DataSetTableName);


"Frank Uray" wrote:
Hi all

I have a timout problem when I call "DataAdapter.Fill".
When I debug, I see that all timeout settings are correct,
ConnectionTimeout is 0 and also CommandTimeout is 0.

But when I call the fill method I get:
"Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding."} System.Exception
{System.Data.SqlClient.SqlException}

Here is what I do:
Conn.ConnectionString = "Data Source=ServerXY;Initial Catalog=master;Connect
Timeout=0;Integrated Security=SSPI;"
Command.CommandTimeout = 0
System.Data.SqlClient.SqlDataAdapter local_DataAdapter = new
System.Data.SqlClient.SqlDataAdapter(Query, Conn);
System.Data.DataSet local_DataSet = new System.Data.DataSet();
local_DataAdapter.Fill(local_DataSet, DataSetTableName);

Thanks for any comments !!

Regards
Frank
Oct 15 '07 #3

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

Similar topics

9
by: jensen bredal | last post by:
I have a dataView and i only want to get the first x rows . Is there a way of doing this without using Foreach? Thanks JB
1
by: Big Dave | last post by:
I'm having trouble using the update command of a dataadapter. It would help if I could watch it go through each record in the datatable and see what it's doing. Is there a way to do this? Also,...
5
by: .Net Sports | last post by:
I have an open datareader that gets data from an sql statement, but when I try to put it into a dataset so that my datagrid can pick it up, I get a 'System.Data.SqlClient.SqlDataReader' does not...
3
by: Tom Luetz II | last post by:
I'm having some trouble with the DataAdapter in my code. When the parameter in an OleDbCommand, which is created as having a type of OleDbType.Decimal, is set to System.DbNull, the actual value...
3
by: Ed | last post by:
Hi, I want to load data to a table in Sql Server from a dataset table in my vb.net app using a dataAdapter. I know how to do this as follows (my question is to see if I can reduce the amount...
3
by: Jo Schambach | last post by:
I am trying to write a GUI with tkinter that displays the stdout from a regular C/C++ program in a text widget. The idea i was trying to use was as follows: 1) use "popen" to execute the C/C++...
0
by: dalaeth | last post by:
I have searched Google high and low and haven't found anything that works. Here's my problem, hopefully someone will be able to help! I'm using 1.1 Framework, and ODP.NET 9.5.0.7 on a Windows...
1
by: Joey Nolan | last post by:
Hi, I have a PDF file on my site that I want to distribute freely but I want to be able to contact anyone who downloaded it to warn them about mistakes and modification and new versions and...
2
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is...
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,...
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: 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: 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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.