Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Timeout on populating a datagrid

Reply
Thread Tools

Timeout on populating a datagrid

 
 
Paul
Guest
Posts: n/a
 
      05-05-2004
I sometimes get a timeout error when populating my datagrid,

the code is
WizardConnection.Open()

UpdateCommand.CommandText = "EXECUTE sp_assign_user '" &
PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'"

UpdateCommand.ExecuteNonQuery()

WizardConnection.Close()


Any suggestions?
Thanks
Paul

The error is :


Server Error in '/EmpLinkage' Application.


Timeout expired
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Timeout expired

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80040e31): Timeout expired]
System.Data.OleDb.OleDbDataReader.ProcessResults(I nt32 hr)
System.Data.OleDb.OleDbDataReader.NextResult()
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior)

System.Data.OleDb.OleDbCommand.System.Data.IDbComm and.ExecuteReader(CommandB
ehavior behavior)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
EmpLinkage.WebForm1.datagrid() in
\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:18 3
EmpLinkage.WebForm1.GOButton_Click(Object sender, EventArgs e) in
\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:26 1
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      05-05-2004
Hi Paul:

It doens't look like the problem is DataGrid related, but in the
stored procedure you use to update a record in the database.

I'd review the stored procedure SQL in a query tool and see how long
the query is taking. Perhaps the stored procedure is trying to update
a record in a large table and does not have an index available to find
the record quickly.

HTH,

--
Scott
http://www.OdeToCode.com

On Wed, 5 May 2004 11:30:50 -0400, "Paul" <(E-Mail Removed)> wrote:

>I sometimes get a timeout error when populating my datagrid,
>
>the code is
>WizardConnection.Open()
>
>UpdateCommand.CommandText = "EXECUTE sp_assign_user '" &
>PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'"
>
>UpdateCommand.ExecuteNonQuery()
>
>WizardConnection.Close()
>
>
>Any suggestions?
>Thanks
>Paul
>
>The error is :
>
>
>Server Error in '/EmpLinkage' Application.
>
>
>Timeout expired
>Description: An unhandled exception occurred during the execution of the
>current web request. Please review the stack trace for more information
>about the error and where it originated in the code.
>
>Exception Details: System.Data.OleDb.OleDbException: Timeout expired
>
>Source Error:
>
>An unhandled exception was generated during the execution of the current web
>request. Information regarding the origin and location of the exception can
>be identified using the exception stack trace below.
>
>Stack Trace:
>
>[OleDbException (0x80040e31): Timeout expired]
> System.Data.OleDb.OleDbDataReader.ProcessResults(I nt32 hr)
> System.Data.OleDb.OleDbDataReader.NextResult()
> System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
>behavior, String method)
> System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior)
>
>System.Data.OleDb.OleDbCommand.System.Data.IDbCom mand.ExecuteReader(CommandB
>ehavior behavior)
> System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
>startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
>CommandBehavior behavior)
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
>Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
>behavior)
> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
> EmpLinkage.WebForm1.datagrid() in
>\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:1 83
> EmpLinkage.WebForm1.GOButton_Click(Object sender, EventArgs e) in
>\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:2 61
> System.Web.UI.WebControls.Button.OnClick(EventArgs e)
>
>System.Web.UI.WebControls.Button.System.Web.UI.IP ostBackEventHandler.RaisePo
>stBackEvent(String eventArgument)
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
>sourceControl, String eventArgument)
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
> System.Web.UI.Page.ProcessRequestMain()
>


 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      05-05-2004
The sproc is reading not updating any database, depending upon the selection
criteria the sproc can take upto 30 seconds to complete, but asp.net doesn't
seem to want to wait that long.

Thanks


"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:(E-Mail Removed)...
> Hi Paul:
>
> It doens't look like the problem is DataGrid related, but in the
> stored procedure you use to update a record in the database.
>
> I'd review the stored procedure SQL in a query tool and see how long
> the query is taking. Perhaps the stored procedure is trying to update
> a record in a large table and does not have an index available to find
> the record quickly.
>
> HTH,
>
> --
> Scott
> http://www.OdeToCode.com
>
> On Wed, 5 May 2004 11:30:50 -0400, "Paul" <(E-Mail Removed)> wrote:
>
> >I sometimes get a timeout error when populating my datagrid,
> >
> >the code is
> >WizardConnection.Open()
> >
> >UpdateCommand.CommandText = "EXECUTE sp_assign_user '" &
> >PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'"
> >
> >UpdateCommand.ExecuteNonQuery()
> >
> >WizardConnection.Close()
> >
> >
> >Any suggestions?
> >Thanks
> >Paul
> >
> >The error is :
> >
> >
> >Server Error in '/EmpLinkage' Application.
> >
> >
> >Timeout expired
> >Description: An unhandled exception occurred during the execution of the
> >current web request. Please review the stack trace for more information
> >about the error and where it originated in the code.
> >
> >Exception Details: System.Data.OleDb.OleDbException: Timeout expired
> >
> >Source Error:
> >
> >An unhandled exception was generated during the execution of the current

web
> >request. Information regarding the origin and location of the exception

can
> >be identified using the exception stack trace below.
> >
> >Stack Trace:
> >
> >[OleDbException (0x80040e31): Timeout expired]
> > System.Data.OleDb.OleDbDataReader.ProcessResults(I nt32 hr)
> > System.Data.OleDb.OleDbDataReader.NextResult()
> > System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
> >behavior, String method)
> > System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior)
> >

>
>System.Data.OleDb.OleDbCommand.System.Data.IDbCom mand.ExecuteReader(Command

B
> >ehavior behavior)
> > System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
> >startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> >CommandBehavior behavior)
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32

startRecord,
> >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> >behavior)
> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
> > EmpLinkage.WebForm1.datagrid() in
> >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:1 83
> > EmpLinkage.WebForm1.GOButton_Click(Object sender, EventArgs e) in
> >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:2 61
> > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
> >

>
>System.Web.UI.WebControls.Button.System.Web.UI.IP ostBackEventHandler.RaiseP

o
> >stBackEvent(String eventArgument)
> > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
> >sourceControl, String eventArgument)
> > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
> > System.Web.UI.Page.ProcessRequestMain()
> >

>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      05-05-2004
You could set a longer timeout but that's already quite long. I would check
first if it makes sense it take so much time. How many records are returned
?


"Paul" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> The sproc is reading not updating any database, depending upon the

selection
> criteria the sproc can take upto 30 seconds to complete, but asp.net

doesn't
> seem to want to wait that long.
>
> Thanks
>
>
> "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
> news:(E-Mail Removed)...
> > Hi Paul:
> >
> > It doens't look like the problem is DataGrid related, but in the
> > stored procedure you use to update a record in the database.
> >
> > I'd review the stored procedure SQL in a query tool and see how long
> > the query is taking. Perhaps the stored procedure is trying to update
> > a record in a large table and does not have an index available to find
> > the record quickly.
> >
> > HTH,
> >
> > --
> > Scott
> > http://www.OdeToCode.com
> >
> > On Wed, 5 May 2004 11:30:50 -0400, "Paul" <(E-Mail Removed)> wrote:
> >
> > >I sometimes get a timeout error when populating my datagrid,
> > >
> > >the code is
> > >WizardConnection.Open()
> > >
> > >UpdateCommand.CommandText = "EXECUTE sp_assign_user '" &
> > >PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'"
> > >
> > >UpdateCommand.ExecuteNonQuery()
> > >
> > >WizardConnection.Close()
> > >
> > >
> > >Any suggestions?
> > >Thanks
> > >Paul
> > >
> > >The error is :
> > >
> > >
> > >Server Error in '/EmpLinkage' Application.
> > >
> > >
> > >Timeout expired
> > >Description: An unhandled exception occurred during the execution of

the
> > >current web request. Please review the stack trace for more information
> > >about the error and where it originated in the code.
> > >
> > >Exception Details: System.Data.OleDb.OleDbException: Timeout expired
> > >
> > >Source Error:
> > >
> > >An unhandled exception was generated during the execution of the

current
> web
> > >request. Information regarding the origin and location of the exception

> can
> > >be identified using the exception stack trace below.
> > >
> > >Stack Trace:
> > >
> > >[OleDbException (0x80040e31): Timeout expired]
> > > System.Data.OleDb.OleDbDataReader.ProcessResults(I nt32 hr)
> > > System.Data.OleDb.OleDbDataReader.NextResult()
> > > System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
> > >behavior, String method)
> > > System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior

behavior)
> > >

> >

>
>System.Data.OleDb.OleDbCommand.System.Data.IDbCom mand.ExecuteReader(Command
> B
> > >ehavior behavior)
> > > System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
> > >startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> > >CommandBehavior behavior)
> > > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32

> startRecord,
> > >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> > >behavior)
> > > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
> > > EmpLinkage.WebForm1.datagrid() in
> > >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:1 83
> > > EmpLinkage.WebForm1.GOButton_Click(Object sender, EventArgs e) in
> > >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:2 61
> > > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
> > >

> >

>
>System.Web.UI.WebControls.Button.System.Web.UI.IP ostBackEventHandler.RaiseP
> o
> > >stBackEvent(String eventArgument)
> > > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
> > >sourceControl, String eventArgument)
> > > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
> > > System.Web.UI.Page.ProcessRequestMain()
> > >

> >

>
>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      05-05-2004
Hi Paul:

Sorry for the confusion, the source code you posted shows
ExecuteNonQuery, but the stack trace shows the exception occurs on a
Fill method.

The CommandTimeout property of an OleDbCommand object defaults to 30
seconds. Seems possible it could occasionally be going over.


One approach would be to look at ways to speed up the query, and
check for locking and blocks in the database. Another approach would
be to bump the CommandTimeout property up to a number where the query
can always safely complete.

--s

On Wed, 5 May 2004 13:30:51 -0400, "Paul" <(E-Mail Removed)> wrote:

>The sproc is reading not updating any database, depending upon the selection
>criteria the sproc can take upto 30 seconds to complete, but asp.net doesn't
>seem to want to wait that long.
>
>Thanks
>
>
>"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
>news:(E-Mail Removed).. .
>> Hi Paul:
>>
>> It doens't look like the problem is DataGrid related, but in the
>> stored procedure you use to update a record in the database.
>>
>> I'd review the stored procedure SQL in a query tool and see how long
>> the query is taking. Perhaps the stored procedure is trying to update
>> a record in a large table and does not have an index available to find
>> the record quickly.
>>
>> HTH,
>>
>> --
>> Scott
>> http://www.OdeToCode.com
>>
>> On Wed, 5 May 2004 11:30:50 -0400, "Paul" <(E-Mail Removed)> wrote:
>>
>> >I sometimes get a timeout error when populating my datagrid,
>> >
>> >the code is
>> >WizardConnection.Open()
>> >
>> >UpdateCommand.CommandText = "EXECUTE sp_assign_user '" &
>> >PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'"
>> >
>> >UpdateCommand.ExecuteNonQuery()
>> >
>> >WizardConnection.Close()
>> >
>> >
>> >Any suggestions?
>> >Thanks
>> >Paul
>> >
>> >The error is :
>> >
>> >
>> >Server Error in '/EmpLinkage' Application.
>> >
>> >
>> >Timeout expired
>> >Description: An unhandled exception occurred during the execution of the
>> >current web request. Please review the stack trace for more information
>> >about the error and where it originated in the code.
>> >
>> >Exception Details: System.Data.OleDb.OleDbException: Timeout expired
>> >
>> >Source Error:
>> >
>> >An unhandled exception was generated during the execution of the current

>web
>> >request. Information regarding the origin and location of the exception

>can
>> >be identified using the exception stack trace below.
>> >
>> >Stack Trace:
>> >
>> >[OleDbException (0x80040e31): Timeout expired]
>> > System.Data.OleDb.OleDbDataReader.ProcessResults(I nt32 hr)
>> > System.Data.OleDb.OleDbDataReader.NextResult()
>> > System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
>> >behavior, String method)
>> > System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior)
>> >

>>
>>System.Data.OleDb.OleDbCommand.System.Data.IDbCo mmand.ExecuteReader(Command

>B
>> >ehavior behavior)
>> > System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
>> >startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
>> >CommandBehavior behavior)
>> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32

>startRecord,
>> >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
>> >behavior)
>> > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
>> > EmpLinkage.WebForm1.datagrid() in
>> >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:1 83
>> > EmpLinkage.WebForm1.GOButton_Click(Object sender, EventArgs e) in
>> >\\sta2wd08\wwwroot$\EmpLinkage\WebForm1.aspx.vb:2 61
>> > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
>> >

>>
>>System.Web.UI.WebControls.Button.System.Web.UI.I PostBackEventHandler.RaiseP

>o
>> >stBackEvent(String eventArgument)
>> > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
>> >sourceControl, String eventArgument)
>> > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
>> > System.Web.UI.Page.ProcessRequestMain()
>> >

>>

>


--
Scott
http://www.OdeToCode.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating a DataGrid Bob Hollness ASP .Net 4 01-12-2005 07:43 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Populating a datagrid ... how is it done normally? Prime ASP .Net 2 10-01-2004 01:35 AM
Datagrid Dropdown not populating =?Utf-8?B?VGltOjouLg==?= ASP .Net 1 08-20-2004 01:39 PM
Populating a datagrid from two separate data sources John ASP .Net 1 07-31-2003 06:46 AM



Advertisments