Changed Underlying Table Structure -- How to Update Project Dataset?

VS 2k5 using VB

I'm still designing my Windows app and have made some changes to the underlying tables (keys, relationships). I can't seem to find a way to update the dataset in my project with the new table info. I created the db/tables in SQL Express.

In Data Sources, I've tried using "Configure Dataset with Wizard" and "Refresh" to see if it will update the dataset with the new info. It goes through the motions, but the new table structure/info seems to be ignored.

So far, the only thing that seems to work is to delete the dataset from my project and then add the db/tables again as a new data source... or, if I've only made changes to only one or two tables, I can just delete those tables from the dataset and add them again using "Configure Dataset with Wizard." That certainly works, however, I then have to manually reset all the column default values in each of the tables, and redo all the table adapter queries, etc.

I've searched through Help, this forum, and Google, but can't seem to find anything on this.

Thanks,
George




Answer this question

Changed Underlying Table Structure -- How to Update Project Dataset?

  • NickNotYet

    Is there a xxx.mdf in your "solution explorer" You may try to modify it and then the changes will reflect in "Server explorer". Drap and drop table from Server explorer, new typed dataset will be generated.

  • Ceres629

    Do you have a copy of database in your project



  • Sriman

    Yes. All tables and all columns were checked. However, after using "Configure Dataset with Wizard," the existing project dataset in the Data Source Explorer does not reflect the changes made to the underlying tables, therefore, the Dataset Designer also does not reflect those changes.
    For instance, in the Server Explorer, I changed the primary key in one table, and I also changed the relationship in another table. Neither of those two changes are reflected in the existing project dataset after using "Configure Dataset with Wizard" and "Refresh" to bring in the new table structure.
    It seems the only way to get changes made to the underlying data source is to delete the dataset from the project and add it back as a new data source... or, after making changes to the tables in Server Explorer, you must manually make the same changes again in the Dataset Designer. With the first way, you lose any/all changes you previously made to the dataset, including all the column default values which you are forced to set manually because VS ignores the default values in the underlying DB. With the second way, you have to make the exact same changes in two different places.
    I hope I'm missing something, but I'm beginning to think this is by design. I thought I was missing something about the column default values being ignored, but it turned out that was by design.

  • VashTheStampede

    Yes, there is an .mdf in my Solutions Explorer and the changes to that .mdf were, in fact, made in the Server Explorer.

    Apparently, there is no way you can get those changes incorporated into the "existing" typed dataset.

  • carjo

    Yes, there is an .mdf db in my project. The existing typed dataset I am referring to was created when I added the .mdf as my data source.

    I am trying to update the project typed dataset with the new key and relationship changes I made to the tables in Server Explorer without having to delete the project dataset and re-add the .mdf as a data source, or without having to make those table changes to the dataset manually, as previously noted in my other messages.

    This would seem to be a pretty typical need of anyone developing a new app, unless, of course, you are a database engineer and can get your table structure right the first time around.

  • GrandpaB

  • Grant Jenkins

    You are right. So what you want is to keep the existing typed dataset as well as the value in it I think the only way to keep data is to do those changes like add/remove/modify columns programly. I believe that will be a complex job. Alternative, try to find a way in which you can fill data conveniently.

  • Ronaldlee Ejalu

    In the Data Source Configuration Wizard when the database objects window, you can expand the tables and te columns down to select the columns.

     

    Or you can go to the Edit Dataset With Designer, right click on the changed table, select configure, and just update the query there with the query editor.

     

    Regards,

     

    david



  • gmeadows94410

    I found it very difficult to deal with significant DB changes once most of the development had already been done.

    The nature of the apps I build require sudden changes to DB's (clients change their mind).

    Instead of using the drag and drop method of databinding etc, I've been trying to perform the same functionality programatically (similar to VB6 and the RecordSet)

    Still trying to nut out a few things tho.

  • Changed Underlying Table Structure -- How to Update Project Dataset?