Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello guys,
First of all I would like to thank you all for helping each other, and specially helping me to get my answers.

I am going to develop a windows application that serves many users by sharing the database between users.
One of the application functions is to swipe items between two users, so the first user check (on the application installed on his pc) for specific item once he find it, he will order the item, a notification should appear on the owner Screen to tell him that someone need this item, then he can do accept ot reject.
The question is how to create such service that stay listening for requests as long as the PC ON.
I use C#, WPF application, sqlite for now ( i should use sql server in order to share data?).
Thanks

What I have tried:

I didn’t try anything for now, i am waiting for suggestions
Posted
Updated 12-Feb-18 8:52am

Yes, you can use SQL server database to share data and detect data changes to push notification for specific user. See:
SqlDependency Class (System.Data.SqlClient)[^]
Detecting Changes with SqlDependency | Microsoft Docs[^]
Using SqlDependency for data change events[^]

Good luck!
 
Share this answer
 
As SQL Server is not the easiest database to install and manage, I would recommend using PostgreSQL instead, here is an introduction: Using PostgreSQL in your C# (.NET) application (An introduction)[^]
Talking about notifications to other users, here is an CodeProject article (take note Maciej :)) about it with example code (sadly not WPF) A PostgreSQL Notification Example[^]
 
Share this answer
 
v2
Comments
Maciej Los 12-Feb-18 15:02pm    
True. SQL server is NOT pretty straightforward...
Note, that OP requirement is to notify user about changes in a database. I'd add this link: Notify events from PostgreSQL to external listeners to complete your answer. ;)
RickZeeland 12-Feb-18 15:09pm    
Updated the answer, at your service :)
Maciej Los 12-Feb-18 15:15pm    
Upvoted!
RickZeeland 12-Feb-18 15:29pm    
Thanks, we Polish ? (sort of) people should support each other :)
Maciej Los 12-Feb-18 15:51pm    
Yes, i'm a Pole. Are you? On a site of your profile i see: Netherlands.
My logic is: no matter of nationality we need to support each other. In other words: we are children of World ;)
[EDIT]
Check LinkedIn ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900