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) 1 9402
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)
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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:...
|
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...
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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,...
| |