Getting a Timeout using an ObjectDataSource

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Cooper

    Getting a Timeout using an ObjectDataSource

    I've got a report that is using an ObjectDataSourc e 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 ObjectDataSourc e to do this. How can I set
    the Timeout property on an ObjectDataSourc e?

    Thanks,

    Andrew
  • Andrew Cooper

    #2
    Re: Getting a Timeout using an ObjectDataSourc e

    Andrew Cooper wrote:
    I've got a report that is using an ObjectDataSourc e 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 ObjectDataSourc e to do this. How can I set
    the Timeout property on an ObjectDataSourc e?
    >
    Thanks,
    >
    Andrew

    Okay, this really shouldn't be as hard as it is turning out to be. It
    looks like the only way to access the CommandTimeOut property on the
    ObjectDataSourc e is to create a Partial Class and then set the property
    there. Here's the code I got online to do this...

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

    Namespace programTableAda pters
    {
    Partial Public Class OrderTableAdapt er
    {
    public void SetCommandTimeo ut(int timeout)
    {
    foreach (IDbCommand command in CommandCollecti on)
    command.Command Timeout = timeout;
    }
    }
    }

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

    I tried converting it over to VB but I've run into problems. My code is
    below. This issue is that the CommandCollecti on 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.Visua lBasic

    Namespace NewReportingDat aSet
    Partial Public Class usp_Billing_Rep ort_by_MainTabl eAdapter
    Public Sub SetCommandTimeo ut(ByVal timeout As Integer)
    Dim test As System.Data.IDb Command

    For Each test In CommandCollecti on
    test.CommandTim eout = timeout
    Next
    End Sub
    End Class
    End Namespace

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

    Thanks,

    Andrew

    Comment

    Working...