populate dataset using collection

  • Thread starter Thread starter Jaaz
  • Start date Start date
I would imagine this is a sitution where you would have to write the
code yourself, because how the dataset should be built, depends
entierly on what you store in the collection.

A rough overview of the dataset is

DataSet
DataTables
DataRows
DataColumns

So what you would need to do it create a DataTable for your values and
then add DataColumns which corresponds to the name and datatype of
the values you want to store. Once that has been done, then you will
need to loop your collection (foreach if it supports IEnumerable) and
add a new DataRow for each item in the collection, inserting the values
into the correct columns.

I guess you could write something generic using reflection as well.

--
ANDREAS HÅKANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
Can any one point to a code in which a dataset is
populated with a collection.
 
Back
Top