Re: Syncronize dataset with database in multithreaded application.
- From: "David Browne" <davidbaxterbrowne no potted meat@xxxxxxxxxxx>
- Date: Mon, 19 Mar 2007 16:57:17 -0500
"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.
First you don't need byref. The DataSet is a reference type, so it's allways passed by reference.
The easiest pattern and most reliable pattern I know of for this is to simply replace your DataSet instance with a new one periodically. The clients will see the new data the next time they access the DataSet. Of course you need make sure client code doesn't cache the reference to the shared DataSet.
David
.
- Prev by Date: Re: How do i move an SQLDatabase to another location?
- Next by Date: Re: How do i move an SQLDatabase to another location?
- Previous by thread: How do i move an SQLDatabase to another location?
- Next by thread: Re: Syncronize dataset with database in multithreaded application.
- Index(es):
Relevant Pages
|