Forum is place where lots of people ask question and same way many people give answer for the question.
i want that when some one will post question and whoever seeing that question opening that page and in the mean time if anyone give answer for that question then that answer will be broad cast to all user who is on that question page. i want to do it with
signalr.
we know that signalr has hub and from there we can hit database periodically and fetch the status and inform all user about the status by broadcast but hitting db periodically may not be good approach rather when db will be updated then something will inform
my hug with some data and then hug will broadcast that data to all user who is on that question page.
my 1st concern is when db will be updated how do i know programmatically ? 2nd concern how do i call signalr hub method from out side with data fetch from db?
so please guide me how could i know when db updated without polling technique rather i want something which push updated data to signalr hub automatically when db updated?
also another important question is how to inform signalr hub from out side with data or passing parameter ? if possible discuss in details with some sample code. thanks
Well for the database, you can simply add that trigger logic in your code where you add the new row to the table. To see how to call hub methods from the outside the hub, see the following:
Participant
1347 Points
2399 Posts
Real Time Forum Notification system
Feb 17, 2014 08:44 AM|mou_inn|LINK
Forum is place where lots of people ask question and same way many people give answer for the question.
i want that when some one will post question and whoever seeing that question opening that page and in the mean time if anyone give answer for that question then that answer will be broad cast to all user who is on that question page. i want to do it with signalr.
we know that signalr has hub and from there we can hit database periodically and fetch the status and inform all user about the status by broadcast but hitting db periodically may not be good approach rather when db will be updated then something will inform my hug with some data and then hug will broadcast that data to all user who is on that question page.
my 1st concern is when db will be updated how do i know programmatically ? 2nd concern how do i call signalr hub method from out side with data fetch from db?
so please guide me how could i know when db updated without polling technique rather i want something which push updated data to signalr hub automatically when db updated?
also another important question is how to inform signalr hub from out side with data or passing parameter ? if possible discuss in details with some sample code. thanks
</div>Member
70 Points
40 Posts
Re: Real Time Forum Notification system
Feb 17, 2014 05:57 PM|abhishek.nanda|LINK
Well for the database, you can simply add that trigger logic in your code where you add the new row to the table. To see how to call hub methods from the outside the hub, see the following:
http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#callfromoutsidehub
All-Star
52711 Points
9668 Posts
MVP
Re: Real Time Forum Notification system
Feb 18, 2014 12:42 AM|Ruchira|LINK
You can use SqlDependency for that.
Check the Brij's blog post below
http://techbrij.com/database-change-notifications-asp-net-signalr-sqldependency
Please 'Mark as Answer' if this post helps you
Developer Tools Download | Windows 10 Videos | My Tech BlogParticipant
1347 Points
2399 Posts
Re: Real Time Forum Notification system
Feb 18, 2014 08:35 AM|mou_inn|LINK
what is the meaning of this 2 line
i guess the above two line we need to write in global.asax in app_start?
what is GlobalHost ? is the code based on persistent connection i guess. i mostly viewer hub related code.