"Cannot change DataType of a column once it has data" error in Visual Studio 2005 DataSet Designer

I get the same error but only for columns with its DefaultValue set to any value (except the default <DBNull>). So the way I got around this issue was:

  1. Column DefaultValue : Type in <DBNull>
  2. Save and reopen the dataset

Since filled Datatables do not entertain a change in the schema a workaround can be applied as follows:

  1. Make a new datatable

  2. Use datatable's Clone method to create the datatable with the same structure and make changes to that column

  3. In the end use datatable's ImportRow method to populate it with data.

HTH


I have found a work around. If I delete the data column and add it back with the different data type, then it will work.