I want some help in copying certain columns from one dataset into another dataset in C#. The mapping for the columns is stored in the xml file.
Suppose I have a source dataset with columns –
calldate,
percent,
value
and a destination dataset with columns –
name,
amount
The mapping xml file has, columns from source dataset and destination column names. Exclude attribute helps in identifying if the column will be copied or not.
XML:
<data>
<column name="calldate" destination="name" exclude="false" />
<column name="percent" destination="" exclude="true" />
<column name="value" destination="amount" exclude="false" />
</data>
How to copy the columns calldate and value from source dataset to name and amount columns of the destination dataset respectively? Note: the datatypes will be same – string and double. At this time I am not concerned about the xml part. I will take care of that once I figure out how to copy specific columns to respective column in the destination dataset.
For example if
dtis the table you’re working with,