How can I update a DataSet with data from a remote server?

J

Jim Walsh

We have a .NET Winforms GUI that is displaying information in a
DataGrid that is bound to a DataTable in an ADO.NET DataSet. This
DataSet needs to be populated and then receive and display frequent
updates to certain cells.

The source of this data is a legacy system running on a remote
(non-Windows) server that sends the initial data and updates to the
client via socket connection. We have control over the line protocol
and so insertion of new rows is easy if we send the data in XML and
use the DataSet.ReadXml() method.

1) What is the easiest way of updating the Dataset without using
explicit searches and updates? I thought it might be possible to use
XML Diffgrams, but I'm not sure they are designed for this purpose.

2) What are the threading issues involved in modifying a DataSet that
is being displayed? We want the GUI to be responsive during
(potentially large) inserts updates and also need to consider having
the user update the DataSet in addition to the updates coming in from
the remote server.

3) Any other issues to consider?

Many thanks
Jim
 
M

Miha Markic [MVP C#]

Hi Jim,

Jim Walsh said:
We have a .NET Winforms GUI that is displaying information in a
DataGrid that is bound to a DataTable in an ADO.NET DataSet. This
DataSet needs to be populated and then receive and display frequent
updates to certain cells.

The source of this data is a legacy system running on a remote
(non-Windows) server that sends the initial data and updates to the
client via socket connection. We have control over the line protocol
and so insertion of new rows is easy if we send the data in XML and
use the DataSet.ReadXml() method.

1) What is the easiest way of updating the Dataset without using
explicit searches and updates? I thought it might be possible to use
XML Diffgrams, but I'm not sure they are designed for this purpose.


Get a dataset with updates from remote server and do a Merge.
Note - that it won't delete rows for you.
2) What are the threading issues involved in modifying a DataSet that
is being displayed? We want the GUI to be responsive during
(potentially large) inserts updates and also need to consider having
the user update the DataSet in addition to the updates coming in from
the remote server.

If the dataset is bound, it can be only updated in main thread...
This applies only for Merge method. While fetching the updates can run in
different thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top