Results 1 to 2 of 2

Thread: [2.0] Table relationships between dataTables in ado.net how???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    [2.0] Table relationships between dataTables in ado.net how???

    I read an xml document into a Dataset. The dataset has 3 Datatables.

    I want the data that exists in 2 datatables.

    I need some help in queying these two datatables and storing the desired results into oracle table.

    Data in the "CashFlows" datatable ( 3 fields in the datatable):

    I35 0 0
    I40 1 0
    I45 2 0

    Data in the "CF" datatable (3 fields in the datatable):

    2000 JasonSmith 0
    3000 Jerymith 0
    4000 Johnperry 1
    5000 kkkkkkkkkk 1
    7000 westwood 2

    I want to link these two datatables, based on second field from "Cashflows" data table and third field in the "CF" datatable. so the desired resultset should be :

    I35 2000 JasonSmith
    I40 3000 Jersmith
    I45 4000 Johnperry

    Can some one point me / direct me how to do this ?

    nath

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Table relationships between dataTables in ado.net how???

    For the relationship you just create a DataRelation, specifying the parent and child tables and columns. There's no in-built class that will perform a join of two DataTables though. You can use methods of the parent DataRows to get their child rows but you'd have to construct the resulting table yourself.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width