c# - how Synchronize database with Context object -
i take new context object in main window context object die when close window
public main_window() { initializecomponent(); } datacontext db = new datacontext();
my problem after created datacontextdb if change date in database management studio not changing in datacontextdb update datacontextdb must close window , open 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 in db.employee select new {a.name};
result a.name "aaaa"
3-change employee name management studio "bbbb"
4- select using linq again
var q=from in db.employee select new {a.name};
result a.name stile "aaaa" why when changed employee name management studio "bbbb" not changed in object datacontext until close window , open again , have other question when create context object load database in object?
Comments
Post a Comment