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. Auto Run Procedures In Windows App

Auto Run Procedures In Windows App

Scheduled Pinned Locked Moved C#
databasehelpcsharpdebuggingannouncement
5 Posts 3 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.
  • G Offline
    G Offline
    GermanDM
    wrote on last edited by
    #1

    Hi, I'm sitting with a weird problem. I created an application in C# 2005 Express. It has 3 timer controls in it. The first timer runs as a clock (system clock) and once this timer reaches a specific time during the day it runs its procedure (this works fine) The 2nd timer has its Interval set to 10min. So every 10 minutes it needs to run its procedure.(doesn't do it) The 3rd timer has its Interval set to 10Sec. So every 10 second it needs to run its two procedures (doesn't do it either); Now when i run this app in debug mode everything works perfect. Breakpoints are being reached all the time, I don't see any problems. But once i publish the app and install it on a users machine it doesn't always run the procedures :confused: As u probably realized is that this application is an auto update app which auto updates data (retrieve data from webservice then update the local SQL database) Any help would be greatly appreciated. I need to get this working by midday tomorrow. Any other suggestions would be great. Thanks

    J B 2 Replies Last reply
    0
    • G GermanDM

      Hi, I'm sitting with a weird problem. I created an application in C# 2005 Express. It has 3 timer controls in it. The first timer runs as a clock (system clock) and once this timer reaches a specific time during the day it runs its procedure (this works fine) The 2nd timer has its Interval set to 10min. So every 10 minutes it needs to run its procedure.(doesn't do it) The 3rd timer has its Interval set to 10Sec. So every 10 second it needs to run its two procedures (doesn't do it either); Now when i run this app in debug mode everything works perfect. Breakpoints are being reached all the time, I don't see any problems. But once i publish the app and install it on a users machine it doesn't always run the procedures :confused: As u probably realized is that this application is an auto update app which auto updates data (retrieve data from webservice then update the local SQL database) Any help would be greatly appreciated. I need to get this working by midday tomorrow. Any other suggestions would be great. Thanks

      J Offline
      J Offline
      jowecape
      wrote on last edited by
      #2

      Why don't u use threads to run your code. You can use your time to control the different threads in your app.

      G 1 Reply Last reply
      0
      • G GermanDM

        Hi, I'm sitting with a weird problem. I created an application in C# 2005 Express. It has 3 timer controls in it. The first timer runs as a clock (system clock) and once this timer reaches a specific time during the day it runs its procedure (this works fine) The 2nd timer has its Interval set to 10min. So every 10 minutes it needs to run its procedure.(doesn't do it) The 3rd timer has its Interval set to 10Sec. So every 10 second it needs to run its two procedures (doesn't do it either); Now when i run this app in debug mode everything works perfect. Breakpoints are being reached all the time, I don't see any problems. But once i publish the app and install it on a users machine it doesn't always run the procedures :confused: As u probably realized is that this application is an auto update app which auto updates data (retrieve data from webservice then update the local SQL database) Any help would be greatly appreciated. I need to get this working by midday tomorrow. Any other suggestions would be great. Thanks

        B Offline
        B Offline
        buchstaben
        wrote on last edited by
        #3

        try logging some "I'm in this method" statements and see which code is not executed. debug mode may work since one breakpoint pauses all threads.

        G 1 Reply Last reply
        0
        • J jowecape

          Why don't u use threads to run your code. You can use your time to control the different threads in your app.

          G Offline
          G Offline
          GermanDM
          wrote on last edited by
          #4

          I was doing this but gets too complicated to run one procedure say at 13:00 everyday and 2 other procedures on different time intervals. If i run a procedure under a timers tick event, isn't that set in its own thread too? I'm just worried that if two different procedures run at the same time so they don't crash or something.

          1 Reply Last reply
          0
          • B buchstaben

            try logging some "I'm in this method" statements and see which code is not executed. debug mode may work since one breakpoint pauses all threads.

            G Offline
            G Offline
            GermanDM
            wrote on last edited by
            #5

            I did that by using message boxes and it worked but then sometimes it just doesn't work. I have changed some values it seems to be working now but i still feel unsafe. Will do more tests thanks.

            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