Visual Studio Inserting Duplicate Columns when Select Query Updated RRS feed

  • Question

  • VB.Net project, linking to a SQL 2008 Database with ADO.NET.

    I have a Dataset with a "loadhed" table. Having now updated the SQL Schema, I wish to bring the DataSet's schema into line with the SQL Database schema.

    However, when new columns are added from the DataSource, either by using the Query Builder, or by modifying the SELECT statement for the DataTable's data adapter directly, Visual Studio inserts new columns into the DataTable, which are duplicates of some of the columns that already exist, appending the number 1 to the end of each.

    One of these is the primary key column for the table. The original datacolumns have their Source property removed when this takes place, suggesting that the mappings are being changed automatically.

    If the project is then debugged, the Fill method for the table fails, due to there being two primary key fields.

    I'm stumped, and relatively new to ADO development - can anyone give me some indication of where I might be going wrong here?

    Friday, March 25, 2011 4:12 PM

All replies

  • Update - Seems to be connected to updated SQL Server Data Types. If the type differs, the designer sees it as a new column, adds a slightly different name, and moves the mapping.

    Makes sense. All I need to do now is figure out how to handle the fact they have changed.

    Friday, March 25, 2011 5:02 PM