473,320 Members | 1,817 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,320 software developers and data experts.

Changing the Timeout property on an ObjectDataSource

I posted this in the aspnet newsgroup but thought I might have more luck
with an answer here. I'd really appreciate any help I can get. Thanks.

I've got a report that is using an ObjectDataSource to populate its
data. The problem is that the report takes longer than 30 seconds to
generate so it times out. If I were using an SQLDataSource object I
know how to set the Command.Timeout to account for this but I can't find
the Timeout property on the ObjectDataSource to do this. How can I set
the Timeout property on an ObjectDataSource?

It looks like the only way to access the CommandTimeOut property on the
ObjectDataSource is to create a Partial Class and then set the property
there. Here's the code I got online to do this...

-------------------

Namespace programTableAdapters
{
Partial Public Class OrderTableAdapter
{
public void SetCommandTimeout(int timeout)
{
foreach (IDbCommand command in CommandCollection)
command.CommandTimeout = timeout;
}
}
}

-------------------

I tried converting it over to VB but I've run into problems. My code is
below. This issue is that the CommandCollection doesn't seem to exist
anywhere. Any help with this would be greatly appreciated. It's
frustrating to have everything working and the only thing holding me up
is a stupid Timeout error.

-------------------

Imports Microsoft.VisualBasic

Namespace NewReportingDataSet
Partial Public Class usp_Billing_Report_by_MainTableAdapter
Public Sub SetCommandTimeout(ByVal timeout As Integer)
Dim test As System.Data.IDbCommand

For Each test In CommandCollection
test.CommandTimeout = timeout
Next
End Sub
End Class
End Namespace

-------------------

Thanks,

Andrew
Sep 24 '08 #1
0 2246

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

Similar topics

3
by: MSR | last post by:
Hi, I have a query that takes 1 min 50 secs to execute in Query analyser (SQL Server 2000). When i execute this query from vb using ADO i get the 'Timeout Expired' error. I have tried setting...
4
by: Jack | last post by:
Hi, I was wondering if for an application, I can change the default session timeout property via IIS Administration? If so, how does one do it. Thanks in advance.
0
by: Joey Chömpff | last post by:
LS, I've an object who has an readonly property named Id, this property is filled from the database with an Identity-value. When I execute "DetailsView1.UpdateItem(true);" then I get the...
0
by: koekemoerzj | last post by:
I have a dataset that is filled by a sp in SQL2005. The sp results can be 1 - 100 records. Depending on the parameters. The execution time can take up to 2 min. Depending on the parameters. The...
0
by: Anabela Silva | last post by:
To anyone who has experienced this problem! Could not find a property named '... ' on the type specified by the DataObjectTypeName property in ObjectDataSource '...' I've been looking at...
0
by: Bryce Fischer | last post by:
I've got a simple (I think) asp.net application. I've created a DataSet in App_Code/ItemDataSet.xsd. Tested connection, seemed to work fine. In my ASPX file, I first dropped an...
1
by: KJ | last post by:
Hello all, I have several objects which use indexers, such as (in C#): public string this { get { return BaseEntity; }
1
by: Allan Ebdrup | last post by:
I have a asp.net v2 website that runs fine on our development server. I have published the website to a stage server and it runs fine, but when I publish it to production I get the following error:...
1
by: Andrew Cooper | last post by:
I've got a report that is using an ObjectDataSource to populate its data. The problem is that the report takes longer than 30 seconds to generate so it times out. If I were using an SQLDataSource...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
0
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.