473,545 Members | 1,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timeout on populating a datagrid

I sometimes get a timeout error when populating my datagrid,

the code is
WizardConnectio n.Open()

UpdateCommand.C ommandText = "EXECUTE sp_assign_user '" &
PhysOffice.Sele ctedValue & "', '" & Context.User.Id entity.Name & "'"

UpdateCommand.E xecuteNonQuery( )

WizardConnectio n.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.Ole Db.OleDbExcepti on: 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.Ole Db.OleDbDataRea der.ProcessResu lts(Int32 hr)
System.Data.Ole Db.OleDbDataRea der.NextResult( )
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteReader( CommandBehavior behavior)

System.Data.Ole Db.OleDbCommand .System.Data.ID bCommand.Execut eReader(Command B
ehavior behavior)
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
EmpLinkage.WebF orm1.datagrid() in
\\sta2wd08\wwwr oot$\EmpLinkage \WebForm1.aspx. vb:183
EmpLinkage.WebF orm1.GOButton_C lick(Object sender, EventArgs e) in
\\sta2wd08\wwwr oot$\EmpLinkage \WebForm1.aspx. vb:261
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP o
stBackEvent(Str ing eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()
Nov 18 '05 #1
4 3916
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" <pe@nospam.co m> wrote:
I sometimes get a timeout error when populating my datagrid,

the code is
WizardConnecti on.Open()

UpdateCommand. CommandText = "EXECUTE sp_assign_user '" &
PhysOffice.Sel ectedValue & "', '" & Context.User.Id entity.Name & "'"

UpdateCommand. ExecuteNonQuery ()

WizardConnecti on.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.Ole Db.OleDbExcepti on: 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.Ole Db.OleDbDataRea der.ProcessResu lts(Int32 hr)
System.Data.Ole Db.OleDbDataRea der.NextResult( )
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteReader( CommandBehavior behavior)

System.Data.Ol eDb.OleDbComman d.System.Data.I DbCommand.Execu teReader(Comman dB
ehavior behavior)
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavio r behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
EmpLinkage.WebF orm1.datagrid() in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:183
EmpLinkage.WebF orm1.GOButton_C lick(Object sender, EventArgs e) in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:261
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)

System.Web.UI. WebControls.But ton.System.Web. UI.IPostBackEve ntHandler.Raise Po
stBackEvent(St ring eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceContro l, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()


Nov 18 '05 #2
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:47******** *************** *********@4ax.c om...
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" <pe@nospam.co m> wrote:
I sometimes get a timeout error when populating my datagrid,

the code is
WizardConnecti on.Open()

UpdateCommand. CommandText = "EXECUTE sp_assign_user '" &
PhysOffice.Sel ectedValue & "', '" & Context.User.Id entity.Name & "'"

UpdateCommand. ExecuteNonQuery ()

WizardConnecti on.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.Ole Db.OleDbExcepti on: Timeout expired

Source Error:

An unhandled exception was generated during the execution of the current webrequest. Information regarding the origin and location of the exception canbe identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80040e31): Timeout expired]
System.Data.Ole Db.OleDbDataRea der.ProcessResu lts(Int32 hr)
System.Data.Ole Db.OleDbDataRea der.NextResult( )
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteReader( CommandBehavior behavior)


System.Data.Ol eDb.OleDbComman d.System.Data.I DbCommand.Execu teReader(Comman d

B
ehavior behavior)
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavio r behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
EmpLinkage.WebF orm1.datagrid() in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:183
EmpLinkage.WebF orm1.GOButton_C lick(Object sender, EventArgs e) in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:261
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)


System.Web.UI. WebControls.But ton.System.Web. UI.IPostBackEve ntHandler.Raise P

o
stBackEvent(St ring eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceContro l, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()

Nov 18 '05 #3
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" <pe@nospam.co m> a écrit dans le message de
news:uI******** ******@TK2MSFTN GP12.phx.gbl...
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:47******** *************** *********@4ax.c om...
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" <pe@nospam.co m> wrote:
I sometimes get a timeout error when populating my datagrid,

the code is
WizardConnecti on.Open()

UpdateCommand. CommandText = "EXECUTE sp_assign_user '" &
PhysOffice.Sel ectedValue & "', '" & Context.User.Id entity.Name & "'"

UpdateCommand. ExecuteNonQuery ()

WizardConnecti on.Close()
Any suggestions?
Thanks
Paul

The error is :
Server Error in '/EmpLinkage' Application.
Timeout expired
Description: An unhandled exception occurred during the execution of thecurrent web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Ole Db.OleDbExcepti on: 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 canbe identified using the exception stack trace below.

Stack Trace:

[OleDbException (0x80040e31): Timeout expired]
System.Data.Ole Db.OleDbDataRea der.ProcessResu lts(Int32 hr)
System.Data.Ole Db.OleDbDataRea der.NextResult( )
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteReader( CommandBehavior
behavior)


System.Data.Ol eDb.OleDbComman d.System.Data.I DbCommand.Execu teReader(Comman d
Behavior behavior)
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavio r behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
EmpLinkage.WebF orm1.datagrid() in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:183
EmpLinkage.WebF orm1.GOButton_C lick(Object sender, EventArgs e) in
\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:261
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)


System.Web.UI. WebControls.But ton.System.Web. UI.IPostBackEve ntHandler.Raise P
o
stBackEvent(St ring eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceContro l, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()


Nov 18 '05 #4
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" <pe@nospam.co m> 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:47******* *************** **********@4ax. com...
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" <pe@nospam.co m> wrote:
>I sometimes get a timeout error when populating my datagrid,
>
>the code is
>WizardConnecti on.Open()
>
>UpdateCommand. CommandText = "EXECUTE sp_assign_user '" &
>PhysOffice.Sel ectedValue & "', '" & Context.User.Id entity.Name & "'"
>
>UpdateCommand. ExecuteNonQuery ()
>
>WizardConnecti on.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.Ole Db.OleDbExcepti on: Timeout expired
>
>Source Error:
>
>An unhandled exception was generated during the execution of the currentweb >request. Information regarding the origin and location of the exceptioncan >be identified using the exception stack trace below.
>
>Stack Trace:
>
>[OleDbException (0x80040e31): Timeout expired]
> System.Data.Ole Db.OleDbDataRea der.ProcessResu lts(Int32 hr)
> System.Data.Ole Db.OleDbDataRea der.NextResult( )
> System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
>behavior, String method)
> System.Data.Ole Db.OleDbCommand .ExecuteReader( CommandBehavior behavior)
>


System.Data.O leDb.OleDbComma nd.System.Data. IDbCommand.Exec uteReader(Comma nd

B
>ehavior behavior)
> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
>startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
>CommandBehavio r behavior)
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32startRecord, >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
>behavior)
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet)
> EmpLinkage.WebF orm1.datagrid() in
>\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:183
> EmpLinkage.WebF orm1.GOButton_C lick(Object sender, EventArgs e) in
>\\sta2wd08\www root$\EmpLinkag e\WebForm1.aspx .vb:261
> System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
>


System.Web.UI .WebControls.Bu tton.System.Web .UI.IPostBackEv entHandler.Rais eP

o
>stBackEvent(St ring eventArgument)
> System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
>sourceContro l, String eventArgument)
> System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
> System.Web.UI.P age.ProcessRequ estMain()
>


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #5

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

Similar topics

2
1565
by: Adel | last post by:
Hello guys Does any one know about how to inforce sorting on a specific coloumn in a datagrid before populating it ? Thanks in advance
2
10560
by: Robert | last post by:
I'm sure this is a fairly basic question, but I've been looking all over the web for days for suggestions on how to do this. I've got a datagrid that's bound to a dataset on my form. It includes several columns, the last of which (with the header Quantity) contains int16 values. When a user selects a row, I would like to have a combobox on...
2
1273
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 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...
5
2267
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a collection object -- say, a dictionary. Populating that collection object with custom objects, say, Person. What I really want to see is how to...
6
1796
by: fripper | last post by:
I want to populate the cells of a DataGrid at run time. I don't want to bind a database to it I simply want to do some calculations and put results into the grid programmatically. I did this in VB 6.0 using the FlexGrid control but the I cannot figure out how to specify the row/column of the cell I want to set in the .Net DataGrid control...
1
1765
by: Mike P | last post by:
I am populating a drop down column in a datagrid on page load. Here is my code : <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlUserName" Font-Name="Verdana" Font-Size="8pt" Runat=server DataValueField="UserName" DataTextField="UserName" DataSource='<%# GetUserList() %>'>
1
45154
by: Ron | last post by:
Hi, I had a stored procedure on SQL 2000 server to run calculation with large amount of data. When I called this stored procedure via System.Data.SqlClient.SqlCommand on production, i got error as: (i tried to run the stored procedure on query analyzer, and it works well) Timeout expired. The timeout period elapsed prior to completion of...
4
6926
by: sorcerdon | last post by:
Hello! I am looking for someone who has solved this multi-million people's problem. EVERYONE seems to ahve this problem. Im a creating a data set and populating it with a call to a store proc. Its a complex stored proc with the end result as an insert to a temp table. Then I do a select from the temp table - in the store proc.
8
3054
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report reflect the values they anticipate committing to see hypothetical totals of columns from a set of records. These records are displaying properly...
0
7465
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7416
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5969
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4944
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1878
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 we have to send another system
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.