Timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lou Civitella

    Timeout

    I am setting the source of a crystal report and sometimes get a Timeout
    error.
    How can I increase the timeout?
    It seems to timeout after 30 seconds.

    Here is a snippet of the code that I use.
    Using VB 2005

    Dim oRpt As New ReportDocument
    Dim strConnectionSt ring As String = "Data Source=Server1; Initial
    Catalog=Databas e1;Persist Security Info=True;User ID=test;Passwor d=password"
    Dim conn As New SqlConnection(s trConnectionStr ing)
    Dim strSQL as String = "SELECT * FROM Table1"

    Dim DS As New Data.DataSet
    Dim DA As New SqlDataAdapter( strSQL, conn)

    DA.Fill(DS)

    oRpt.Load(Appli cation.StartupP ath.ToString &
    "\Reports\pc_de tail_employee.r pt")
    oRpt.SetDataSou rce(DS.Tables(0 ))

    Thanks,
    Lou


  • W.G. Ryan - MVP

    #2
    Re: Timeout

    Add Connection Timeout = Whatever at the end of the connection string.
    "Lou Civitella" <lou@webersyste ms.com> wrote in message
    news:%23Fjd5K7Y GHA.2376@TK2MSF TNGP03.phx.gbl. ..[color=blue]
    >I am setting the source of a crystal report and sometimes get a Timeout
    >error.
    > How can I increase the timeout?
    > It seems to timeout after 30 seconds.
    >
    > Here is a snippet of the code that I use.
    > Using VB 2005
    >
    > Dim oRpt As New ReportDocument
    > Dim strConnectionSt ring As String = "Data Source=Server1; Initial
    > Catalog=Databas e1;Persist Security Info=True;User
    > ID=test;Passwor d=password"
    > Dim conn As New SqlConnection(s trConnectionStr ing)
    > Dim strSQL as String = "SELECT * FROM Table1"
    >
    > Dim DS As New Data.DataSet
    > Dim DA As New SqlDataAdapter( strSQL, conn)
    >
    > DA.Fill(DS)
    >
    > oRpt.Load(Appli cation.StartupP ath.ToString &
    > "\Reports\pc_de tail_employee.r pt")
    > oRpt.SetDataSou rce(DS.Tables(0 ))
    >
    > Thanks,
    > Lou
    >[/color]


    Comment

    • Marina Levit [MVP]

      #3
      Re: Timeout

      Before the fill, do:

      DA.SelectComman d.CommandTimeou t = ??

      Replace the '??' with whatever value you feel is appropriate. You can use 0
      for an infinite timeout.

      "Lou Civitella" <lou@webersyste ms.com> wrote in message
      news:%23Fjd5K7Y GHA.2376@TK2MSF TNGP03.phx.gbl. ..[color=blue]
      >I am setting the source of a crystal report and sometimes get a Timeout
      >error.
      > How can I increase the timeout?
      > It seems to timeout after 30 seconds.
      >
      > Here is a snippet of the code that I use.
      > Using VB 2005
      >
      > Dim oRpt As New ReportDocument
      > Dim strConnectionSt ring As String = "Data Source=Server1; Initial
      > Catalog=Databas e1;Persist Security Info=True;User
      > ID=test;Passwor d=password"
      > Dim conn As New SqlConnection(s trConnectionStr ing)
      > Dim strSQL as String = "SELECT * FROM Table1"
      >
      > Dim DS As New Data.DataSet
      > Dim DA As New SqlDataAdapter( strSQL, conn)
      >
      > DA.Fill(DS)
      >
      > oRpt.Load(Appli cation.StartupP ath.ToString &
      > "\Reports\pc_de tail_employee.r pt")
      > oRpt.SetDataSou rce(DS.Tables(0 ))
      >
      > Thanks,
      > Lou
      >[/color]


      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Timeout

        > Add Connection Timeout = Whatever at the end of the connection string.

        As long as it is a value and more than 0 'or you would like rusian roulette

        Gets the time to wait (in seconds) while trying to establish a connection before terminating the attempt and generating an error.


        Cor


        Comment

        Working...