如何在DataContext中重新加载特定对象(Table)

时间:2023-02-03 23:10:06

I'm using the same Data Context for my entire WPF application. How can I reload a specific object from the database? I tried the Refresh function of the data context for that object to no success.

我在整个WPF应用程序中使用相同的数据上下文。如何从数据库重新加载特定对象?我尝试了该对象的数据上下文的Refresh函数没有成功。

1 个解决方案

#1


0  

You do;

YourDataContext = null; YourDataContext = Database.Read();

YourDataContext = null; YourDataContext = Database.Read();

#1


0  

You do;

YourDataContext = null; YourDataContext = Database.Read();

YourDataContext = null; YourDataContext = Database.Read();