Home All Groups Group Topic Archive Search About

How to fill a datatable with data from another datatable

Author
27 Feb 2006 3:55 PM
Coen
Hi, can anyone advice me in the following.

My steps to perform are:
1) Importing data from csv-files into datatables of a typed dataset (the
input tables)
2) I need to fill other datatables based on the datatables in step a (the
output tables)
3) The datatables from step 2 are used to create CR-Reports

My question is: can anyone advice me how to realise step 2: I need to fill
the allready defined, but still empty, datatables from the typed dataset. I
would like to use functionallity like "Select Col1, Col2, Col5 From
DatatableX Where ColId = xxx" to fill the datatables in step 2, but so far I
know this is not possible. Does it make sense to use framework 2.0 instead of
1.1. Woulkd this help? Or does anyone know how to get the (output) datatables
filled?

Btw: performance in this case is important!

Any help is welcome,
Coen.

Author
27 Feb 2006 9:01 PM
Aboulfazl Hadi
Hi
You can use Select method of first datatable to retrieve an array of
selected datarow. you can set filter expression and sorting statement
to get appropriate rows.

then use LoadDataRow method of datatable to load rows into second
DataTable.

I Hope this helps
A.Hadi
Author
28 Feb 2006 7:57 AM
Coen
Hi Aboulfazl, thanks for respond. I have found another way to solve my
problem. I now use the dataview with the rowfilter method. Then I loop
through all the dataview's rows, make for each row a newrow for the output
table, and fill the necessary fields. Maybe not the most eligant way but I
works fine to me.

Anyway, thanks for your cooperation.
Regards Coen.



Show quote
"Aboulfazl Hadi" wrote:

> Hi
> You can use Select method of first datatable to retrieve an array of
> selected datarow. you can set filter expression and sorting statement
> to get appropriate rows.
>
> then use LoadDataRow method of datatable to load rows into second
> DataTable.
>
> I Hope this helps
> A.Hadi
>
>

AddThis Social Bookmark Button