By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

TimeOut on SqlDataAdapter.Fill

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.