473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

TimeOut on SqlDataAdapter.Fill

Dan
I've created a web form which fills a DataGrid with a DataSet generated from
the SqlDataAdapter.Fill method. The adapter's query takes about 30 seconds
to complete when I run it in the SQL Server Query Analyzer, but when I run
it from my web page I kept getting a TimeOut exception. So then, as an
experiment, I changed the way I created the adapter to the following:

SqlConnection conn = new SqlConnection(m_Conn);
SqlCommand sqlCommand = new SqlCommand(m_Query, conn);
sqlCommand.CommandTimeout = 0;
m_Adapter = new SqlDataAdapter(sqlCommand);

However, I'm still getting the TimeOut exception on the adapter.Fill method.
What do I need to do to make this work? The relevant portion of the
exception reads as follows:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding. at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream) at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior) at
System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(Comman
dBehavior behavior) at
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
Nov 18 '05 #1
1 9342
Dan
Never mind. I had an extraneous databound column in my datagrid.
"Dan" <da*@dontspamme.com> wrote in message
news:ej**************@TK2MSFTNGP10.phx.gbl...
I've created a web form which fills a DataGrid with a DataSet generated from the SqlDataAdapter.Fill method. The adapter's query takes about 30 seconds to complete when I run it in the SQL Server Query Analyzer, but when I run
it from my web page I kept getting a TimeOut exception. So then, as an
experiment, I changed the way I created the adapter to the following:

SqlConnection conn = new SqlConnection(m_Conn);
SqlCommand sqlCommand = new SqlCommand(m_Query, conn);
sqlCommand.CommandTimeout = 0;
m_Adapter = new SqlDataAdapter(sqlCommand);

However, I'm still getting the TimeOut exception on the adapter.Fill method. What do I need to do to make this work? The relevant portion of the
exception reads as follows:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding. at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(Comman dBehavior behavior) at
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

Nov 18 '05 #2

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

Similar topics

0
by: Polly | last post by:
I have a datatable i am filling with database data using the SqlDataAdapter. This works fine using the test database. When i run it on the production database, it will sometimes work but sometimes...
2
by: Dan | last post by:
I've created a web form which fills a DataGrid with a DataSet generated from the SqlDataAdapter.Fill method. The adapter's query takes about 30 seconds to complete when I run it in the SQL Server...
3
by: Matt | last post by:
I'm having an issue with returning a large amount of data into a dataset. When the query returns thousands of lines of data (in Query Analyzer it can take 2 minutes) I receive the following error:...
7
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise...
3
by: Robert Brown | last post by:
Hi All.. I am experiencing Timeouts after about 30-40 seconds when trying to fill a dataset from SQL. I have seen a lot of posts mentioning to set the commandtimeout property, but how do you...
9
by: pmcguire | last post by:
I have a vb.NET solution with a Windows Application project that contains my user interface and a Class Library project that contains (among other things) a class I call DataAccessComponent. This...
0
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to...
3
by: Lou Civitella | last post by:
I am setting the source of a crystal report and sometimes get a Timeout error. How can I increase the timeout? It seems to timeout after 30 seconds. Here is a snippet of the code that I use....
2
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
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...
1
by: Leon Mayne | last post by:
Hello, I had a chunk of code that would execute a stored proc to migrate data between two systems (takes a few minutes) and then performs some data manipulation on the migrated data. This was...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.