none
Question about 2 DataTables and making them a DataRelation RRS feed

  • Question

  • Hello,

    Could someone help me with this?

    I basically have 2 tables...TableA and TableB.
    TableA has a ID Column and each row has a unique ID.
    TableB has a ID_Link Column.  and many of them will match the numbers in ID.  There are also some ID_Links that don't match any IDs in ColumnA.  (And this is why I can't make it a DataRelation yet)

    I would like to generate a new Table (TableC) that gets all the DataRows from TableB that have a matching ID_Link to a matchin ID column in Table A.
    So in other words if TableB.ID_Link has the same value that is found in TableA in one of its DataRows in Column ID add that DataRow from TableB to TableC.


    How would you go about doing this?
    Also I assuming if I use Linq it would be faster than using 2 for loops?

    Thanks in advance!
    Thursday, December 18, 2008 1:48 PM