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. Web Development
  3. ASP.NET
  4. Passing SQL trigger to C# code behind page

Passing SQL trigger to C# code behind page

Scheduled Pinned Locked Moved ASP.NET
databasecsharpquestion
5 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.
  • M Offline
    M Offline
    M A A Mehedi Hasan
    wrote on last edited by
    #1

    Hello, Is there any way to transfer a sql trigger to C# code behind page? Thanks every body. Mehedi Hasan

    G 1 Reply Last reply
    0
    • M M A A Mehedi Hasan

      Hello, Is there any way to transfer a sql trigger to C# code behind page? Thanks every body. Mehedi Hasan

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      What do you mean by transfering the trigger? --- b { font-weight: normal; }

      M 1 Reply Last reply
      0
      • G Guffa

        What do you mean by transfering the trigger? --- b { font-weight: normal; }

        M Offline
        M Offline
        M A A Mehedi Hasan
        wrote on last edited by
        #3

        Ok, I'm discussing the scenario. An external application will insert data in a table in sql server. My application(written in c#) have to pull the data immediately from db and process. But my application does not know when the external application will insert data. So is there any way to notify my application at the time external application insert data in db? Well, one solution may be using a thread which will continously monitor the table. But there may be thousands of row will insert in the table within a second. So I want to use an insert trigger and notify my application but don't know how? Will u help me? Thanks. Mehedi Hasan

        G 1 Reply Last reply
        0
        • M M A A Mehedi Hasan

          Ok, I'm discussing the scenario. An external application will insert data in a table in sql server. My application(written in c#) have to pull the data immediately from db and process. But my application does not know when the external application will insert data. So is there any way to notify my application at the time external application insert data in db? Well, one solution may be using a thread which will continously monitor the table. But there may be thousands of row will insert in the table within a second. So I want to use an insert trigger and notify my application but don't know how? Will u help me? Thanks. Mehedi Hasan

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

          You can't use ASP.NET to monitor something like that, unless you can make the database send a web request to the web server, as an ASP.NET page is only running when responding to a request. Of course you can't do that directly from the datbase, but you could construct a program that sends a web request, and call that program from the database. You could also set up a flag; a field in a table that you set to a certain value whenever there is new data to process, and have a process running in the background that is polling the flag continously (e.g. every x seconds), and starts the job whenever there is new data. --- b { font-weight: normal; }

          M 1 Reply Last reply
          0
          • G Guffa

            You can't use ASP.NET to monitor something like that, unless you can make the database send a web request to the web server, as an ASP.NET page is only running when responding to a request. Of course you can't do that directly from the datbase, but you could construct a program that sends a web request, and call that program from the database. You could also set up a flag; a field in a table that you set to a certain value whenever there is new data to process, and have a process running in the background that is polling the flag continously (e.g. every x seconds), and starts the job whenever there is new data. --- b { font-weight: normal; }

            M Offline
            M Offline
            M A A Mehedi Hasan
            wrote on last edited by
            #5

            Dear Guffa, Thanks for ur response. Actually I'm not interested in second solution (polling every x seconds). I want to develop a desktop program to process the data but I don't know how to call the program from database. Please help me regarding this. Mehedi Hasan

            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