How to convert a untyped DataSet object to an strongly typed DataS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have to convert a untyped DataSet object to an strongly typed DataSet
object.

The method DataSet.Merge seen to be a good opportunity to convert the
DataSet. But I am not successfull with this method. Even when I rename the
property DataSetName and Table[0].TableName to exactly the right names.

What could be wrong? Do you have an idea or even better a little sample?

Thank for yout help!

Gerdy
 
Hi Cor!

Thanks for that link!

But it it's unsuggestive of showing how to convert a untyped DataSet object
into a strongly typed dataset.
It just shows how to merge a untyped DataSet with an untyped DataSet! How to
do this is already clear to me.
Perhaps I do not see the hint behind this sample! But this little sample is
not the support I am looking for :-(

Can you or someone else offer some more auxiliary references or relevant
samples showing how to convert a untyped DataSet into a strongly typed DataSet

Gerda
 
Gerda,

A strongly typed dataset inherits from a non strongly typed dataset. Merging
those two means that they have to be in fact almost identical in their
serialized version. (You cannot merge columns which don't exist in the
receiving table, than there will be created two tables).

If I would explain more, please reply.

Cor
 
Hi!

I guess I was very dizzy yesterday when I tried to convert a untyped DataSet
into a strongly typed DataSet!

This morning I found out that just a simple Merge ist the solution I am
looking for!

MyStronglyTypedDataSet stDs = new MyStronglyTypedDataSet();
DataSet untypedDs = new DataSet();
stDs.Merge(untypedDs);

This is all! This is the solution!

Gerda
 
Back
Top