Tricky dataset / datatable question

I have two datatables populated from separate database tables, something like this for example

Datatable1 - 3 columns

101223654 OPOI123365 2500
123547435 KL45468789 3700
123454645 FKKKFD1235 2200

Datatable2 - 3 columns

123545455 DFSDSFDLKK 2200
456468798 DSDSKKKFKL 3500
278990078 SDSLKLKSKK 2000

There are no relationships between the two tables

Somehow I need to loop through both and build a 3rd datatable as follows

3 columns

Table1.Column3 Table2.Column3 (t2.c3 - t1.c3)

So in this example my 3rd datatable would look like this

2500 2200 300
3700 3500 200
2200 2000 200

I'm sure this can be done but am scratching my head about where to start, any advice appreciated.

[725 byte] By [MondeoST24] at [2007-12-16]
# 1
Hi
I think you may select all the rows of the first Table then loop through them
Within the loop you will select all the rows of the second table and create a row object on the basis you mentioned and add this row to the new table you want.
I understand this as a something like the Cross join in T-SQL.
Eisa at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified