none
TableAdapterManager RRS feed

  • Question

  • I am using VB2008.  I am slowly coming up to speed on the TableAdapterManager technology.  I follow how it ties together all the tableadapters for single update operations.  I am curious about how datatables are managed and filled with the TAManager.  Do I use a fill or a getdata method to fill a databable.  Is there any bulk load command at the TAManager level to fill all the dataset datatables.  It looks like you can only fill one datatable at a time.  I like the concept of the TAManager and how it aims to fail gracefully with dataset and database consistent. 

    Thanks,
    Fred
    Friday, December 18, 2009 8:39 PM

Answers

  • Hello Fred,

     

    Glad to see you again!

     

    TableAdapterManager has a method (UpdateAll) to update the whole changeset of a DataSet.  We can see the logic of this method from the source codes of the DataSet.Designer.vb.  To make it simpler, this UpdateAll method will retrieve the updated/inserted/deleted changeset and let each TableAdapter to update the changes.  This method also packages the logic well and uses transaction so as to rollback the changes if necessary. 

     

    For Fill method, we can declare a new method outside the DataSet.Designer.vb since the TableAdapterManager is a partial class.  Then we can call all the TableAdapter.Fill method inside this method.  Which table is first filled and whether to use transactions can be determined by our own scenario.  In my opinion, the Fill operation is much easier than the Update operation, so we don’t need to use very complicated logic here.

     

    If you have any questions, please feel free to let me know.

     

    Have a nice day!

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, December 21, 2009 4:12 AM
    Moderator

All replies

  • Hello Fred,

     

    Glad to see you again!

     

    TableAdapterManager has a method (UpdateAll) to update the whole changeset of a DataSet.  We can see the logic of this method from the source codes of the DataSet.Designer.vb.  To make it simpler, this UpdateAll method will retrieve the updated/inserted/deleted changeset and let each TableAdapter to update the changes.  This method also packages the logic well and uses transaction so as to rollback the changes if necessary. 

     

    For Fill method, we can declare a new method outside the DataSet.Designer.vb since the TableAdapterManager is a partial class.  Then we can call all the TableAdapter.Fill method inside this method.  Which table is first filled and whether to use transactions can be determined by our own scenario.  In my opinion, the Fill operation is much easier than the Update operation, so we don’t need to use very complicated logic here.

     

    If you have any questions, please feel free to let me know.

     

    Have a nice day!

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, December 21, 2009 4:12 AM
    Moderator
  • Hi Fred,

     

    I am writing to check the status of the issue on your side.  Would you mind letting me know the result of the suggestions? 

     

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

     

    Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, December 24, 2009 12:55 AM
    Moderator