make a popup html window based on SQL Trigger Values ?

hi,,,
i'm trying to make a small popup html window on the right bottom corner of user screen,,

this window is created based on a tigger on a table ,when ever
a row is inserted to a user a window well popup on his/her screen..

i need that to look as an Email Notification, or an alert to the user.

i'm developing in Vb.Net & SQL Server..
is there a way to do that , or any idea,,
star4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eyeh8uCommented:
WWW is a pull technology, the user's web browser has to request a page from the server. There is no way the server can push a message to the client's machine to do the popup.

So you need to fake it. You would have to have an HTML page that used a javascript timer, or a meta refresh to reload itself. When reloaded, if it needed to alert the user it would have to create a new window via javascript and position it in the bottom corner.

It would also have to have at least a title bar and close button, you could remove the toolbar and address bar, but it's never going to look quite like an Email Notification alert.

You can find the screen width and height from the screen object, so you'd create a new window and place it in the corner something like:

var left = screen.width - desiredwindowwidth;
var top = screen.height - desiredwindowheight
var hwnd = window.open('alertwindow.html','alert','left='+left+';top='+top);

You woun't be able to fire it from the trigger.
0
star4Author Commented:
if it is not possible , how is Microsoft MSN messanger is working ????
What about Norton AntiVirus Live Update ??????
0
eyeh8uCommented:
It is not possible to trigger an event on a remote client machine via a SQL Server Trigger.

MSN Messenger, Microsoft Outlook and Norton etc are client applications running on the users machine. MSN messenger maintains a stateful connection to a remote server, when it receives a message on it's TCP connection that there is a new message/login/whatever it then uses the Win32 API to create a new window with no border, place it in the bottom corner of the screen and then draws it's interface over it.

To do this, you would have to:
1) Have the trigger insert a row into some kind of "Notification" table
2) Write a VB.NET WINDOWS application that sits on the clients machine running constantly
3) The VB.NET program would have to connect to the database and poll the notification table (do a SELECT on it every x minutes)
4) When it detects a notification, it would remove it so it doesn't trigger again and then use the Win32 api to create a new window with no border and draw the custom interface over it.

It's not possible to make an "Email Notification" style window from HTML and have it appear based on a sql server trigger. It's not possible to have any window appear based on a SQL Server Trigger, triggers execute sp's and SQL statements and functions WITHIN the database.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.