Sign in to follow this  
Followers 0
mstester

Monitoring a MySQL database

2 posts in this topic

Hi all,

Is it possible to wirte some VB.NET code which can detect a change to a database i.e. something being added to a table or deleted?

If it is I would really appricated any pointers on how to go about this :)

Thanks in advanvce

0

Share this post


Link to post
Share on other sites

Generally, you wouldn't want to do it that way. Most enterprise-level relational database software supports what are called 'trigger' functions. These are just little bits of code that you build into the database itself and which get fired when something specific happens, such as a row of data getting added to the database or an existing row getting updated.

You can use these trigger functions to do almost anything, but a typical usage would be to carry out some sort of sanity checking on the data being presented. By doing this job in the trigger function code, you end up with a more 'future proof' database, since it doesn't matter where the data is being presented to you from - it could be from a web-based app, from a command line prompt or from some DB management tool, it would all get validated in the same way. This keeps your data integrity rules where they belong, i.e. in the database itself and also means you don't have to re-code the validation every time you want to add a new interface between the data and the front end application.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.