1

There is MSSQL Express Server and several apps are using it.

App1 adds or updates rows in table1.

Table1 must be loaded in App2. And app2 should use valid data any time. How I can reload table1 data if changes are occured?

using Entity Framework 6.

image

Andrey Busik
  • 441
  • 3
  • 16

2 Answers2

0

App2 needs to "check" the table1 for new data and reload it. You can perform a select on table 1 and look for new rows by ID for example.

Roman Mik
  • 3,179
  • 3
  • 27
  • 49
  • Yes, in [App2 v.1.0] (without Entity Framework) I used endless loop to reload and compare data each second. Now I'm rewriting App2 using Entity Framework... I believe EF should provide some better way? – Andrey Busik Apr 07 '14 at 18:55
  • I'm afraid not, EF will not refresh itself automatically. You must initiate the refresh. Here's a link to a discussion that talks about implementing a refresher http://stackoverflow.com/questions/20270599/entity-framework-refresh-context In a nutshell, you will still have to loop and reload the data. – Roman Mik Apr 07 '14 at 20:04
0

It simple as it looks .

Case 1 : when there is a change in data in table . upon you access to the content ON-LOAD or Post you will get updated data automatically .

Case 2 : When there are changes in columns or table schema etc . you just open edmx after than on the panel where all tables dispalyed Right click and Click Update option and then build which will auto generate entities automatically .

Regards

super cool
  • 6,003
  • 2
  • 30
  • 63