locked
edit tableadapter at runtime RRS feed

  • Question

  • Hi everyone:

    I have created a tableadapter , query and a datagrid for an access database using the datadesigner wizard

    at run time, I have added a new column to the access database

    I need to edit the tableadapter, the query and the datagrid to reflect this change at runtime without using the wizard

    Can you please help me
    Thank you 
    Engineer
    • Moved by VMazur Friday, December 18, 2009 11:29 AM (From:ADO.NET Data Providers)
    Thursday, December 17, 2009 11:56 PM

Answers

  • Hello,

    If you are using a strongly typed DataSet, it is really hard to modify its structure during runtime, because it’s structure has been hard coded.  

    For such a scenario, I recommend you to use a normal DbDataAdapter according to your data provider and use a “SELECT * …” as the SelectCommand for the DbDataAdapter.


    Best Regards,
    Lingzhi Sun


    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.
    Tuesday, December 22, 2009 2:11 PM

All replies

  •  I am using VB2008

    Engineer
    Friday, December 18, 2009 12:01 AM
  • Hello,

    If you are using a strongly typed DataSet, it is really hard to modify its structure during runtime, because it’s structure has been hard coded.  

    For such a scenario, I recommend you to use a normal DbDataAdapter according to your data provider and use a “SELECT * …” as the SelectCommand for the DbDataAdapter.


    Best Regards,
    Lingzhi Sun


    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.
    Tuesday, December 22, 2009 2:11 PM