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. windows service

windows service

Scheduled Pinned Locked Moved C#
help
2 Posts 2 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.
  • R Offline
    R Offline
    rcwoods
    wrote on last edited by
    #1

    Hi I want to use a Windows Service to call certain stored procedures once a day. It needs to pass the DateTime.Now as a variable to these stored procedures. If someone could please help me out as to how i implement a timer and call stored procedures and pass the current datetime to the stored procedures. Thanks

    G 1 Reply Last reply
    0
    • R rcwoods

      Hi I want to use a Windows Service to call certain stored procedures once a day. It needs to pass the DateTime.Now as a variable to these stored procedures. If someone could please help me out as to how i implement a timer and call stored procedures and pass the current datetime to the stored procedures. Thanks

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      You can initialize a variable of System.Threading.Timer in the OnStart method as set up event handler for Elapsed event. In the event handler call the stored procedure using sqlcommand object and pass the parameter by adding it to Parameters collection

      #region signature my articles #endregion

      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