Event handling

  • Thread starter Thread starter Marek Samaj
  • Start date Start date
M

Marek Samaj

Hi.

I wrote simple C# app, that connects to SQL Server 2000 DB using ADO.NET.

I want to monitor inserts to specified table from my app. That is, when
someone inserts a row [or entire rowset] to this table, i want to catch this
"event" and handle it [rather, i want to get the inserted data]. In old C,
this was done with extended stored procedures and system events. Is there
any easier way to do this in C# and ADO.NET?

Thanks for answer.

Regards
Marek Samaj
 
I'd implement this on the server side using triggers or stored
procedures for inserts that take care of the logging for you.
Personally, I prefer the stored procedure approach where you could
wrap the insert to the base table and the logging operation in a
single explicit transaction. All you'd use C# for would be any
exception handling if the operation failed.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
Back
Top