Re: Syncronize dataset with database in multithreaded application.



I hope you are doing locks to access that dataset.
Anyway, there is no magic method to do it for you. You could load data in an empty copy of that dataset and then check out (by comparing) which rows were deleted. Then delete the deleted rows from original dataset and then merge the two.
But you'll still have problems if deleted rows are referenced..you should notify the owner of reference that the row is no longer present or the owner might check DataRow.RowState before dealing with the (possibly) deleted row.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Jess Lundager Andersen" <JessLundagerAndersen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:47FAC310-46CE-444B-971B-3EDF05407C8A@xxxxxxxxxxxxxxxx
Hi
I have a multithreaded application that uses a typed dataset to held
configuration data. The configuration data is also stored in at database.
The dateset is send to the different threads using the byref keyword
From time to time i need to update the dataset in the application.
Using the fill method will work fine adding new rows to the dataset but
dont seem to work if a record has been removed from the database and there
for no longer should be in the dataset.
If I try to use the dataset.clear command before i use the load command it
works fine. But then i get rowerros arround in my application because the
refferenced rows no longer exists.

Do anyone have an idea how to update the dataset properly? without using the
clear method.

Best regards


jess

.


Loading