开发者

Synchronising SQL database through ADO.Net

The problem that i'm having is how can i synchronise my datasets in my VS 2008 project to any changes in the database.

As you know we read data from the db into the dataset which is disconnected, now lets say 1 minute later something updates the data in the databa开发者_如何学Gose. What i want to do is after a set time interval check the db for any updates, i have a column already in my tables in the db that show when that row was last updated and so check this column and return all rows that are greater then the time of my last retrieval into my dataset.

Now the actual issue is what can I do to implement this structure? I was thinking of having some sort of loop that ran every so often which would get my new dataset with only the rows that have been updated but then how do i add those rows to my existing dataset where the existing dataset will replace any rows that are the same with the row from the new data and add any rows that aren't in existing one but are in the new one.

I did look at Sync Framework from Microsoft and the Local Cache but from what i can tell it only works on tables as i am hooking into a Stored Proc, unless i am wrong?

PS. I am coding in C#.

Can anyone help?


datatable.merge

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜