Automate a message box based on UPDATE?

G

Guest

Hello all!

I'm working in vb/ado.net I want to to have a message box pop up based on a
result of a update on a SQL table. How do I do that so it automaticly pops
up after the update is performed?

Also, is there a way to put in a variable in the message box base on the
results of the Update?

TIA!!
Rudy
 
G

Guest

Rudy said:
I'm working in vb/ado.net I want to to have a message box pop up based on a
result of a update on a SQL table. How do I do that so it automaticly pops
up after the update is performed?

Just put the code that shows the message box after the code that updates
the table.
Also, is there a way to put in a variable in the message box base on the
results of the Update?

You can put whatever you want in the string that you use to show the
message box.
 
G

Guest

Hi Goran!

OK, Sorry. Didn't make myself clear on this. I have a server application
and a client application. The update will be executed at the server app, but
after it's done I want the message box to show up on the client app. So how
do I watch that update from the client. I know I can create a click event on
the client to look for the update. But I wouldn't think I would loop that.
Looking fot the best way.

Thanks!

Rudy
 
P

Pritcham

Hi Rudy

It sounds like you want some form of notification sent to the client
app when a change happens at the DB. If this is correct then there's a
couple of options that I'm aware of (depending on your DB).

If you're using SQL 2000 then one of the "common" options is to have an
extended proc that runs via a trigger on the table(s) that you want to
monitor. This proc basically writes details of the change to a file
that is accessible from the client app, and the client app watches this
file for changes using a file-watcher, when a change is picked up, the
client can read the file for what the change was and act accordingly.
I seem to remember something on Codeproject.com that dealt with this.

Alternatively, if you're using SQL 2005 then there is an updated
version of notification services available that will send out
notifications to all interested parties - take a look on MSDN as I'm
sure there's lots of info there.

Hope that helps
 
G

Guest

Hi Pritcham!

Sounds like a good idea!! I'm using SQL 2000. I'll look for that extended
proc. I'll let y you kow how it goes.

Thanks!
Rudy
 
G

Guest

Thanks Martin!

I already got it working with your advice. A little diffrent than what this
article does. I just created a trigger to watch a table for update or
insert. Then it will update a txt file on the server, and a filewatch to
watch that file for a change. One a change happens a a message box will pop
up. The user doesn't have access to the computer, just the app, so I have a
lot of control of the file structure.

Thanks again for your help!

Rudy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top