Groups | Blog | Home
all groups > vb.net data > may 2005 >

vb.net data : I must be missing something simple, no "refresh" method on DataTable?


Rob R. Ainscough
5/2/2005 2:17:07 PM
I have a DataTable that is now disconnected (connection closed). I want the
DataTable to be "refreshed" with data from the source (in this case a MS SQL
Server) -- the problem is the DataTable doesn't appear to have a "refresh"
method??

I looked into GetChanges method, but this seems to ONLY return data that
I've manually changed client side NOT data that was changed at the source
(MS SQL Server) by some other user/event/process.

Any suggestions?

Rob.

Beth Massi [Architect MVP]
5/2/2005 6:14:43 PM
Rob,

The architecture of the ADO.NET DataSet (and DataTable) is completely
disconnected. This means that the dataset/datatable itself has no knowledge
of its source database and can be passed (serialized) as XML to other
applications over the net very easily and quickly. That said, it's the
DataAdapter that connects directly to the database to make a connection,
execute queries and fill datasets. If you need to refresh the set of data in
a DataTable you'll need to execute the query that did the Fill in the first
place. There are also methods on the Dataset that can be used to merge the
data. I suggest reading the ADO.NET Core Reference by David Sceppa, it is an
excellent ADO.NET book.

HTH,
-B

[quoted text, click to view]

AddThis Social Bookmark Button