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. Aborting a running procedure

Aborting a running procedure

Scheduled Pinned Locked Moved C#
question
6 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    How should I abort a running procedure if it takes longer than 10 seconds?

    C C 2 Replies Last reply
    0
    • L Lost User

      How should I abort a running procedure if it takes longer than 10 seconds?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      By setting a 10 second timer and then changing a flag or something. What are you aborting ? I assume a thread.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • L Lost User

        How should I abort a running procedure if it takes longer than 10 seconds?

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        semiramisContraA wrote:

        How should I abort a running procedure if it takes longer than 10 seconds?

        Since this is in the C# forum I'm guessing you actually mean method rather than procedure. If you do mean procedure (as in a stored procedure) then you should proceed to the SQL Server forum and ask there. You can run the method in another thread and WaitFor it to return. When you WaitFor it you can set a time out.

        Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog

        L 1 Reply Last reply
        0
        • C Colin Angus Mackay

          semiramisContraA wrote:

          How should I abort a running procedure if it takes longer than 10 seconds?

          Since this is in the C# forum I'm guessing you actually mean method rather than procedure. If you do mean procedure (as in a stored procedure) then you should proceed to the SQL Server forum and ask there. You can run the method in another thread and WaitFor it to return. When you WaitFor it you can set a time out.

          Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I am trying to call a method of a web service & I want the request to be aborted if the web service takes longer than 10 seconds to answer!

          B 1 Reply Last reply
          0
          • L Lost User

            I am trying to call a method of a web service & I want the request to be aborted if the web service takes longer than 10 seconds to answer!

            B Offline
            B Offline
            Bijesh
            wrote on last edited by
            #5

            If you are using a SoapHttpClientProtocol - derived class to invoke the web service you can set the Timeout property of it to 10 seconds.

            L 1 Reply Last reply
            0
            • B Bijesh

              If you are using a SoapHttpClientProtocol - derived class to invoke the web service you can set the Timeout property of it to 10 seconds.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I'm using MSXML2.XMLHttpClass. & it doesn't have a timeout attribute

              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