If I change data within Microsoft SQL Server Management Studio while my application is running, LINQ will not get the new data, even if I run
myContext.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues)
The only way to get the new changes (that I’ve found so far…) is to recreate the data context.
myContext.Dispose();
myContext = new MyDataContext();
I must be blind and this has to be really obvious, but I’ve wasted enough time on this to allow myself to post this dumb question… -_-”
Thanks!
Edit
When I load data from SQL:
myBindingSource.DataSource = myContext.myTable.Where(o => o.id != 0).OrderBy(o => o.name);
My concept was flawed and a DbContext should not be kept longer then the queries you need to execute. That said, if I want to refresh my data, I should just get a new DbContext instance and refill my data source.