Converting Strongly Typed Datasets

  • Thread starter Thread starter David
  • Start date Start date
D

David

Can you convert a strongly typed dataset to another typed
dataset if the schemas are identical?

Thanks in advance for any insight.

David.
 
David,

You can't convert with a casting operation unless the one you're trying to
convert happens to derive from the conversion target type. That said, there
are various ways to get the data from one to the other. Two of the simplest
approaches to implement are:

1. Use the DataSet.Merge method to get data from the source dataset to a
newly instantiated target dataset.
2. Use DataSet.GetXML or DataSet.WriteXML to retrieve the data from the
source dataset, then use DataSet.ReadXML to write it to the target dataset.

HTH,
Nicole
 
Back
Top