Calling c# code when a table is modified
Posted: Thu 09 Sep 2010 15:49
Hi,
I am a complete newbie to both c# and sqlite and was hoping someone would be able to help me out.
My application needs to do something specific when a new row is added to a particular table in a sqlite database (a third party application adds things into the table, and they won't notify me when they do).
Now in my initial, very dirty, attempt I have my application polling that table every 30s and if there is something new (asserted by checking if a "timestamp" column has a datetime within the last 30s) it then reads the data and acts accordingly.
What I ideally want is to have a method in my Data Access Layer called if any data is added to the table. When a row is added to the table I want it to call my DAL method and give it the row Id.
Is that possible, and if so could someone give me a few hints about how to do it?
FYI: my application is c# .net 4.0
Thanks in advance,
Dan
I am a complete newbie to both c# and sqlite and was hoping someone would be able to help me out.
My application needs to do something specific when a new row is added to a particular table in a sqlite database (a third party application adds things into the table, and they won't notify me when they do).
Now in my initial, very dirty, attempt I have my application polling that table every 30s and if there is something new (asserted by checking if a "timestamp" column has a datetime within the last 30s) it then reads the data and acts accordingly.
What I ideally want is to have a method in my Data Access Layer called if any data is added to the table. When a row is added to the table I want it to call my DAL method and give it the row Id.
Is that possible, and if so could someone give me a few hints about how to do it?
FYI: my application is c# .net 4.0
Thanks in advance,
Dan