Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ADO.net

Options
  • 01-05-2006 10:33am
    #1
    Registered Users Posts: 1,466 ✭✭✭


    I have a hierachical dataset brought back from a sql server stored procedure, for the sake of ease we will say this is the structure :


    StaffID
    <Staff Columns>

    AddressID
    <Address Columns>
    StaffID_FK

    PhoneID
    <Phone Columns>
    AddressID_FK

    Im using a disconnected architecture, so when I receive the dataset , I
    remap the the relationship (is there no way to get this relationship from
    sql server - see's silly remapping). What im now looking to do is to
    duplicate a staff members data , if I copied a row from the Staff table will
    all the related data also be duplicated ? and if it wont whats the best way
    to achieve this result ?


Comments

  • Registered Users Posts: 640 ✭✭✭Kernel32


    If you are using a typed dataset then you can make the relationships and then walk the relationships in code to do a full data copy.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    when you say "walk the relationships in code" what exactly dop you mean ?

    Code the loops around the hierachy and manually copy the data out ?


  • Registered Users Posts: 640 ✭✭✭Kernel32


    Smoggy wrote:
    when you say "walk the relationships in code" what exactly dop you mean ?

    Code the loops around the hierachy and manually copy the data out ?

    Yes. It's pretty easy to do. In a simple set of data like you have it doesn't make much sense in hindsight though. Unless you see this dataset growing in size then just hard code the copy routine.


  • Registered Users Posts: 1,466 ✭✭✭Smoggy


    Yup, I was hoping you werent going to say that , as the above DB Structure was for ease of example the real thing is 20 tables + and being lazy Im looking for the quickest way.


Advertisement