Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Increase Execution time for Sp in webconfig for time out problem

Increase Execution time for Sp in webconfig for time out problem

Scheduled Pinned Locked Moved C#
sharepointhelpquestion
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mugdha_Aditya
    wrote on last edited by
    #1

    i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??

    T realJSOPR D M 4 Replies Last reply
    0
    • M Mugdha_Aditya

      i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??

      T Offline
      T Offline
      TweakBird
      wrote on last edited by
      #2

      Use in Web.Config like this

      Go through this link, You can get good idea about connection strings. connectionstrings[^] P.S: Check why that procedure taking two much time (10 minutes). Happy Coding :)

      Regards, Eswar

      M 1 Reply Last reply
      0
      • T TweakBird

        Use in Web.Config like this

        Go through this link, You can get good idea about connection strings. connectionstrings[^] P.S: Check why that procedure taking two much time (10 minutes). Happy Coding :)

        Regards, Eswar

        M Offline
        M Offline
        Mugdha_Aditya
        wrote on last edited by
        #3

        Thanks for the swift reply.. like this means..how?? because i want syntax...where to add and ahta i have to add i check link given by you...but it has nt mention any where....any thing related to time out

        T 1 Reply Last reply
        0
        • M Mugdha_Aditya

          Thanks for the swift reply.. like this means..how?? because i want syntax...where to add and ahta i have to add i check link given by you...but it has nt mention any where....any thing related to time out

          T Offline
          T Offline
          TweakBird
          wrote on last edited by
          #4

          Mugdha_Aditya wrote:

          ike this means..how?? because i want syntax...where to add and ahta i have to add

          For Web.Config concept See this http://msdn.microsoft.com/en-us/library/w7w4sb0w(v=VS.80).aspx[^]

          Mugdha_Aditya wrote:

          i check link given by you...but it has nt mention any where....any thing related to time out

          Link is only about connection strings with respect to different databases & different parameters. Are you want sample syntax of web.config file?

          M 1 Reply Last reply
          0
          • T TweakBird

            Mugdha_Aditya wrote:

            ike this means..how?? because i want syntax...where to add and ahta i have to add

            For Web.Config concept See this http://msdn.microsoft.com/en-us/library/w7w4sb0w(v=VS.80).aspx[^]

            Mugdha_Aditya wrote:

            i check link given by you...but it has nt mention any where....any thing related to time out

            Link is only about connection strings with respect to different databases & different parameters. Are you want sample syntax of web.config file?

            M Offline
            M Offline
            Mugdha_Aditya
            wrote on last edited by
            #5

            i waant to add timeout hours in web config... i want sample for tht... so i can add same thing in my web config for time out

            1 Reply Last reply
            0
            • M Mugdha_Aditya

              i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #6

              10 minutes? Sounds more to me like you need to refactor/refine your stored procedure and schema a bit. I've written queries that take as long as three seconds, but never *minutes*. Believe me when I say the timeout is the least of your worries.

              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
              -----
              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
              -----
              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

              M 1 Reply Last reply
              0
              • realJSOPR realJSOP

                10 minutes? Sounds more to me like you need to refactor/refine your stored procedure and schema a bit. I've written queries that take as long as three seconds, but never *minutes*. Believe me when I say the timeout is the least of your worries.

                ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                -----
                You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                -----
                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

                M Offline
                M Offline
                Mugdha_Aditya
                wrote on last edited by
                #7

                ok..:( but still how can i add time out time in webconfig

                D 1 Reply Last reply
                0
                • M Mugdha_Aditya

                  i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Ummm, I hate to rain on everyones parade here, but changing the timeout in the connection string doesn't work. That's the timeout for the CONNECTION to the database, not the timeout for executing a command on the database. You're looking at CommandTimeout[^]. But, like JSOP said, if you've got a long running query like this, you're best option is to try and improve the query's performance first. Having done that, if still too long, run the query async so your code isn't blocked waiting 10 minutes for the query to return. Look at the Begin* methods of the SqlCommand object.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  • M Mugdha_Aditya

                    ok..:( but still how can i add time out time in webconfig

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #9

                    You can't. That timeout is for connecting to the database, not executing a command on it. See my other post for more info.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak

                    1 Reply Last reply
                    0
                    • M Mugdha_Aditya

                      i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??

                      M Offline
                      M Offline
                      Mahendra Vishwakarma
                      wrote on last edited by
                      #10

                      There are two type of timeout which we can use in asp.net- SqlCommand.CommandTimeout = timeout limit for your SQL query. Means, how much time a (eg: SELECT, UPDATE) query can take for its execution. If it exceeds SqlCommand.CommandTimeout, then it stops execution. A command timeout error will occur. SqlConnection.ConnectionTimeout = timeout limit for your connection. Means, how much time your connection object can try to connect. If it exceeds the specified time, it stops connecting. A connection timeout error will occur. HELLO GUY

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups