Timeout Expired

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

    Timeout Expired

    I am using vb.net to process a SP
    The sp are insert XXX select () statment, there are two parameters , Start
    Company code and End Company Code,
    The user input the range From A to Z or From A to B.
    I found that If the range is A to C , the SP runs fine , if the range is A
    to Z , I will got Timeout Expired error,
    If I run the SP in SQL analyzer, everyting go fines.
    Does the error belong to vb.net ?

    Dim cmd As New SqlClient.SqlCo mmand
    cmd.Connection = conSea
    cmd.CommandText = "dbo.sel_cs_com pany"
    cmd.CommandType = CommandType.Sto redProcedure
    cmd.Parameters. Add(New SqlParameter("@ reportid",
    SqlDbType.VarCh ar, 20)).Value = Me.pReportId

    cmd.ExecuteNonQ uery()
    cmd.Parameters. Clear()
    cmd.Dispose()

    --
    Thanks !

    --
    ..


  • Cor Ligthert

    #2
    Re: Timeout Expired

    Agnes,

    In this code is not much VBNet except that you uses "dim" furter it is exact
    the same as C# without row end stuff.

    You can use the
    cmd.CommandTime out = 160

    However when it stays I would ask it in the newsgroup
    Adonet
    news://msnews.microsoft.com/microsof...amework.adonet

    Web interface:


    I hope this helps?

    Cor

    "Agnes" <agnes@dynamict ech.com.hk>
    [color=blue]
    >I am using vb.net to process a SP
    > The sp are insert XXX select () statment, there are two parameters , Start
    > Company code and End Company Code,
    > The user input the range From A to Z or From A to B.
    > I found that If the range is A to C , the SP runs fine , if the range is A
    > to Z , I will got Timeout Expired error,
    > If I run the SP in SQL analyzer, everyting go fines.
    > Does the error belong to vb.net ?
    >
    > Dim cmd As New SqlClient.SqlCo mmand
    > cmd.Connection = conSea
    > cmd.CommandText = "dbo.sel_cs_com pany"
    > cmd.CommandType = CommandType.Sto redProcedure
    > cmd.Parameters. Add(New SqlParameter("@ reportid",
    > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
    >
    > cmd.ExecuteNonQ uery()
    > cmd.Parameters. Clear()
    > cmd.Dispose()
    >
    > --
    > Thanks !
    >
    > --
    > .
    >
    >[/color]


    Comment

    • Cor Ligthert

      #3
      Re: Timeout Expired

      Agnes,

      In this code is not much VBNet except that you uses "dim" furter it is exact
      the same as C# without row end stuff.

      You can use the
      cmd.CommandTime out = 160

      However when it stays I would ask it in the newsgroup
      Adonet
      news://msnews.microsoft.com/microsof...amework.adonet

      Web interface:


      I hope this helps?

      Cor

      "Agnes" <agnes@dynamict ech.com.hk>
      [color=blue]
      >I am using vb.net to process a SP
      > The sp are insert XXX select () statment, there are two parameters , Start
      > Company code and End Company Code,
      > The user input the range From A to Z or From A to B.
      > I found that If the range is A to C , the SP runs fine , if the range is A
      > to Z , I will got Timeout Expired error,
      > If I run the SP in SQL analyzer, everyting go fines.
      > Does the error belong to vb.net ?
      >
      > Dim cmd As New SqlClient.SqlCo mmand
      > cmd.Connection = conSea
      > cmd.CommandText = "dbo.sel_cs_com pany"
      > cmd.CommandType = CommandType.Sto redProcedure
      > cmd.Parameters. Add(New SqlParameter("@ reportid",
      > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
      >
      > cmd.ExecuteNonQ uery()
      > cmd.Parameters. Clear()
      > cmd.Dispose()
      >
      > --
      > Thanks !
      >
      > --
      > .
      >
      >[/color]


      Comment

      • Agnes

        #4
        Re: Timeout Expired

        I just set commandTimeout = 0 , and there is no error anymore

        --
        ..
        "Cor Ligthert" <notmyfirstname @planet.nl> ¦b¶l¥ó
        news:eK5%23XAE3 EHA.2012@TK2MSF TNGP15.phx.gbl ¤¤¼¶¼g...[color=blue]
        > Agnes,
        >
        > In this code is not much VBNet except that you uses "dim" furter it is[/color]
        exact[color=blue]
        > the same as C# without row end stuff.
        >
        > You can use the
        > cmd.CommandTime out = 160
        >
        > However when it stays I would ask it in the newsgroup
        > Adonet
        > news://msnews.microsoft.com/microsof...amework.adonet
        >
        > Web interface:
        >[/color]
        http://communities2.microsoft.com/co...amework.adonet[color=blue]
        >
        > I hope this helps?
        >
        > Cor
        >
        > "Agnes" <agnes@dynamict ech.com.hk>
        >[color=green]
        > >I am using vb.net to process a SP
        > > The sp are insert XXX select () statment, there are two parameters ,[/color][/color]
        Start[color=blue][color=green]
        > > Company code and End Company Code,
        > > The user input the range From A to Z or From A to B.
        > > I found that If the range is A to C , the SP runs fine , if the range is[/color][/color]
        A[color=blue][color=green]
        > > to Z , I will got Timeout Expired error,
        > > If I run the SP in SQL analyzer, everyting go fines.
        > > Does the error belong to vb.net ?
        > >
        > > Dim cmd As New SqlClient.SqlCo mmand
        > > cmd.Connection = conSea
        > > cmd.CommandText = "dbo.sel_cs_com pany"
        > > cmd.CommandType = CommandType.Sto redProcedure
        > > cmd.Parameters. Add(New SqlParameter("@ reportid",
        > > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
        > >
        > > cmd.ExecuteNonQ uery()
        > > cmd.Parameters. Clear()
        > > cmd.Dispose()
        > >
        > > --
        > > Thanks !
        > >
        > > --
        > > .
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Agnes

          #5
          Re: Timeout Expired

          I just set commandTimeout = 0 , and there is no error anymore

          --
          ..
          "Cor Ligthert" <notmyfirstname @planet.nl> ¦b¶l¥ó
          news:eK5%23XAE3 EHA.2012@TK2MSF TNGP15.phx.gbl ¤¤¼¶¼g...[color=blue]
          > Agnes,
          >
          > In this code is not much VBNet except that you uses "dim" furter it is[/color]
          exact[color=blue]
          > the same as C# without row end stuff.
          >
          > You can use the
          > cmd.CommandTime out = 160
          >
          > However when it stays I would ask it in the newsgroup
          > Adonet
          > news://msnews.microsoft.com/microsof...amework.adonet
          >
          > Web interface:
          >[/color]
          http://communities2.microsoft.com/co...amework.adonet[color=blue]
          >
          > I hope this helps?
          >
          > Cor
          >
          > "Agnes" <agnes@dynamict ech.com.hk>
          >[color=green]
          > >I am using vb.net to process a SP
          > > The sp are insert XXX select () statment, there are two parameters ,[/color][/color]
          Start[color=blue][color=green]
          > > Company code and End Company Code,
          > > The user input the range From A to Z or From A to B.
          > > I found that If the range is A to C , the SP runs fine , if the range is[/color][/color]
          A[color=blue][color=green]
          > > to Z , I will got Timeout Expired error,
          > > If I run the SP in SQL analyzer, everyting go fines.
          > > Does the error belong to vb.net ?
          > >
          > > Dim cmd As New SqlClient.SqlCo mmand
          > > cmd.Connection = conSea
          > > cmd.CommandText = "dbo.sel_cs_com pany"
          > > cmd.CommandType = CommandType.Sto redProcedure
          > > cmd.Parameters. Add(New SqlParameter("@ reportid",
          > > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
          > >
          > > cmd.ExecuteNonQ uery()
          > > cmd.Parameters. Clear()
          > > cmd.Dispose()
          > >
          > > --
          > > Thanks !
          > >
          > > --
          > > .
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Cor Ligthert

            #6
            Re: Timeout Expired

            Agnes,

            Than you can probably as well delete your database without that you get an
            error.
            From the page about that property

            A value of 0 indicates no limit, and should be avoided in a CommandTimeout
            because an attempt to execute a command will wait indefinitely.

            I hope this helps?

            Cor

            "Agnes" <agnes@dynamict ech.com.hk>
            ..[color=blue]
            >I just set commandTimeout = 0 , and there is no error anymore
            >
            > --
            > .
            > "Cor Ligthert" <notmyfirstname @planet.nl> ¦b¶l¥ó
            > news:eK5%23XAE3 EHA.2012@TK2MSF TNGP15.phx.gbl ¤¤¼¶¼g...[color=green]
            >> Agnes,
            >>
            >> In this code is not much VBNet except that you uses "dim" furter it is[/color]
            > exact[color=green]
            >> the same as C# without row end stuff.
            >>
            >> You can use the
            >> cmd.CommandTime out = 160
            >>
            >> However when it stays I would ask it in the newsgroup
            >> Adonet
            >> news://msnews.microsoft.com/microsof...amework.adonet
            >>
            >> Web interface:
            >>[/color]
            > http://communities2.microsoft.com/co...amework.adonet[color=green]
            >>
            >> I hope this helps?
            >>
            >> Cor
            >>
            >> "Agnes" <agnes@dynamict ech.com.hk>
            >>[color=darkred]
            >> >I am using vb.net to process a SP
            >> > The sp are insert XXX select () statment, there are two parameters ,[/color][/color]
            > Start[color=green][color=darkred]
            >> > Company code and End Company Code,
            >> > The user input the range From A to Z or From A to B.
            >> > I found that If the range is A to C , the SP runs fine , if the range
            >> > is[/color][/color]
            > A[color=green][color=darkred]
            >> > to Z , I will got Timeout Expired error,
            >> > If I run the SP in SQL analyzer, everyting go fines.
            >> > Does the error belong to vb.net ?
            >> >
            >> > Dim cmd As New SqlClient.SqlCo mmand
            >> > cmd.Connection = conSea
            >> > cmd.CommandText = "dbo.sel_cs_com pany"
            >> > cmd.CommandType = CommandType.Sto redProcedure
            >> > cmd.Parameters. Add(New SqlParameter("@ reportid",
            >> > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
            >> >
            >> > cmd.ExecuteNonQ uery()
            >> > cmd.Parameters. Clear()
            >> > cmd.Dispose()
            >> >
            >> > --
            >> > Thanks !
            >> >
            >> > --
            >> > .
            >> >
            >> >[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Cor Ligthert

              #7
              Re: Timeout Expired

              Agnes,

              Than you can probably as well delete your database without that you get an
              error.
              From the page about that property

              A value of 0 indicates no limit, and should be avoided in a CommandTimeout
              because an attempt to execute a command will wait indefinitely.

              I hope this helps?

              Cor

              "Agnes" <agnes@dynamict ech.com.hk>
              ..[color=blue]
              >I just set commandTimeout = 0 , and there is no error anymore
              >
              > --
              > .
              > "Cor Ligthert" <notmyfirstname @planet.nl> ¦b¶l¥ó
              > news:eK5%23XAE3 EHA.2012@TK2MSF TNGP15.phx.gbl ¤¤¼¶¼g...[color=green]
              >> Agnes,
              >>
              >> In this code is not much VBNet except that you uses "dim" furter it is[/color]
              > exact[color=green]
              >> the same as C# without row end stuff.
              >>
              >> You can use the
              >> cmd.CommandTime out = 160
              >>
              >> However when it stays I would ask it in the newsgroup
              >> Adonet
              >> news://msnews.microsoft.com/microsof...amework.adonet
              >>
              >> Web interface:
              >>[/color]
              > http://communities2.microsoft.com/co...amework.adonet[color=green]
              >>
              >> I hope this helps?
              >>
              >> Cor
              >>
              >> "Agnes" <agnes@dynamict ech.com.hk>
              >>[color=darkred]
              >> >I am using vb.net to process a SP
              >> > The sp are insert XXX select () statment, there are two parameters ,[/color][/color]
              > Start[color=green][color=darkred]
              >> > Company code and End Company Code,
              >> > The user input the range From A to Z or From A to B.
              >> > I found that If the range is A to C , the SP runs fine , if the range
              >> > is[/color][/color]
              > A[color=green][color=darkred]
              >> > to Z , I will got Timeout Expired error,
              >> > If I run the SP in SQL analyzer, everyting go fines.
              >> > Does the error belong to vb.net ?
              >> >
              >> > Dim cmd As New SqlClient.SqlCo mmand
              >> > cmd.Connection = conSea
              >> > cmd.CommandText = "dbo.sel_cs_com pany"
              >> > cmd.CommandType = CommandType.Sto redProcedure
              >> > cmd.Parameters. Add(New SqlParameter("@ reportid",
              >> > SqlDbType.VarCh ar, 20)).Value = Me.pReportId
              >> >
              >> > cmd.ExecuteNonQ uery()
              >> > cmd.Parameters. Clear()
              >> > cmd.Dispose()
              >> >
              >> > --
              >> > Thanks !
              >> >
              >> > --
              >> > .
              >> >
              >> >[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              Working...