Nayan Ambaliya Ответов: 2

Уведомления в веб-приложении-jquery, c# web API и база данных SQL server


Уважаемые эксперты,

Scenario: People come to a venue and register with the receptionist. The receptionist puts the information in to the database using a web application which uses HTML - jQuery as front-end, C# SOAP services as middle layer and SQL server as the database.

The CEO in the other room interviews people and have access to a front end which displays the list of people in the queue outside - This information is fetched and refreshed on regular intervals - say every 5 minutes.

What I want to achieve is as soon as the receptionist enters the data in the database, the CEO receives a notification kind of message on his screen that a person has been added to the database - this is independent from the regular fetch refresh cycle of the people in the queue which refreshes the grid.

Is there any better way of doing this? 

Thanks.


Что я уже пробовал:

I am aware that you can count the number of rows returned from the database to the number of rows displayed in the front end and if the difference is greater than zero, than the alert should be displayed. But the disadvantage to this is that you have to call the database using two different calls at regular intervals - one that fetches and refreshes the grid on the front end and the other one just brings out the count. This increases the work of the database as well as the middle layer SOAL services as well.

2 Ответов

Рейтинг:
2

Karthik_Mahalingam

в дополнение к вышеприведенному решению проверьте и это
jquery-используйте AJAX для отслеживания изменений в базе данных SQL - переполнение стека[^]


Рейтинг:
1

Dave Kreskowiak

Начните делать кучу исследований по Помощью SignalR[^]. Это позволяет передавать данные клиентам с сервера.