Problem solve Get help with specific problems with your technologies, process and projects.

How can I send a trigger to a client when a record request is posted on the database server?

I need to develop an application that can address the following: Customers will request recording of some programs on tape. So the request is saved on a database (actually, it is an Access database, but we are planning for SQL Server at a later stage). The employees are opening a dynamic Web page containing the recording information. I want this to happen: Whenever a record request is posted, a trigger is sent to the client and an update on the employee Web page is done without refresh. Can you please tell me what should be done on the employees' side and on the server side?
By the very nature of the Web and browsers, what you want to do isn't possible. There's no connection between the server and the client once a specific request has been satisfied. The server returns a response and forgets about the client. There's nothing you can do about that. This functionality is possible only for desktop apps. One workaround is to implement a background polling mechanism in the client-side by using JavaScript and the XmlHttpRequest object. With it, you can post a query to the server for information about changes. If you get new data in the response through the XmlHttpRequest, you can update the page view directly with DHTML from the JavaScript. This means the user will not see a page refresh.

On the server-side, you can either create an empty aspx form that processes these specific kind of posts, or you can create a custom IhttpHandler implementation, associate it with a new 'file' extension and process everything inside it. This is the most professional and reusable approach. However, implementing this feature increases network traffic, so you have to evaluate its benefits carefully.

Dig Deeper on .NET Framework database programming best practices

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.