I am writing an application that is basically a DataGrid attached to a database table, nice and simple. I am using LINQ to SQL and binding to the table via a simple:
dGridd.ItemsSource = _dbcontext.TheTableObjects;
The table successfully shows the table, however the DataGrid does not get updated when I alter the database values externally ( e.g. from MSSQL ). I have followed most instructions here:Simple Demo of Binding to a Database in WPF using LINQ-SQL , with the exception of skipping the use of the ObservableCollection ( which should be no difference, correct? ).
I want the binding to update ( and therefore the datagrid ) when the content of the database table changes externally. Instinctively I said to myself: ‘this is stupid… how can the client application possibly know the database contents without some sort of polling?…’ but then again I dont know just how wizzy LINQ to SQL really is…
jberger provided the best answer.