none
VS2005: detail table update RRS feed

  • Question

  • Hi there,

    I used DataSet designer to generate my TableAdapters and DataTables...etc

     I have a mster table Tickets and child table TicketPortions

     

    In my code I create a new DataTable tickets that I fill with tickets rows

    tickets.NewTicketsRow()

    tickets.AddTicketsRow(_ticket)

    ...etc

    I update the DB without any problem using

    TicketsAdapter.Update(tickets)

     

    Here is my need:

    I also need to update the DataBase table: TicketPortions (the detail table) in one shot

     

    How do I do that, pls?

     

    Because my tickets collection (well a datatable) has for example certain rows (number of tickets). Each row has a certain number of child: ticketPortions rows

     

    I don t want to loop in the tickets collection and call:

    TicketsPortions.UPdate on each ticket.TicketsPortions.

    I want to call update in one shot for all the ticketPortions of all my tickets

     

    I also try to create a new DataTable: ticketsPortions in order to fill it with  the ticketPortions of all my tickets

    But I says: columnId of the ticketsPortions class is read only

     

    Sorry if i m a bit confused, m new to .Net 2.0 and objectDatasource techniques

     

    Thannks a lot for your help.

     

    Thanks a lot

    Monday, July 30, 2007 3:35 PM