I need to display on a datagrid the content of a table from my db (postgresql). I'm using WPF, but I'm considering to migrating to Avalonia. I can easy connect the db in vb.net or c# and populate datagrid. Iusse is that anothe application can write into this db, so data can change, and I need to show ever the actual values.
So there are any way to "bind" the table with the datagrid in a way that the db change is notified? or should I simply put a timer and query every sec.?
Your simplest option is to poll every minute or whatever.
Postgresql has listen and notify but I would not recommend these.
https://www.postgresql.org/docs/9.0/sql-notify.html
Other (more) practical approaches I have seen are quite involved.
EG all updates to the database go via a web layer.
These changes then also store time and change data for every change. Table, id, change type and time.
Clients subscribe to a process uses the above to write changes ready for them to pick up.
The client then can pull just those changes which are applied to an on client cache.
Alternatively there is a push service which sends changes to the client.
Often using web sockets.
The fully refined implementation seems likely to be massive overkill but can support huge numbers of clients. EG for online betting ( where the client is in a browser ) each player needs to see changing odds and new events appear.