i take new Context object in main Window so Context object die only when i Close that window
public Main_Window()
{
InitializeComponent();
}
DataContext DB = new DataContext();
my problem is after i created DataContextDB if i change the date in database from management studio not changing in DataContextDB to update the DataContextDB i must close the window and open it again
example 1 -create object
public partial class Main_Window: Window
{
public Main_Window()
{
InitializeComponent();
}
DataContext DB = new DataContext();
}
2- select using linq
var Q=from a in DB.Employee select new {a.Name};
result a.Name "AAAA"
3-change Employee name from management studio to "BBBB"
4- select using linq again
var Q=from a in DB.Employee select new {a.Name};
result a.Name Stile "AAAA" why when i changed the Employee name from management studio to "BBBB" not changed in object DataContext until to close window and open it again and i have other question when i Create Context object then i load all database in this object?