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

firedfly picture firedfly · Sep 6, 2008 · Viewed 20.1k times · Source

I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the following error:

Property value is not valid. Cannot change DataType of a column once it has data.

From my understanding, this should be changing the datatype in the schema for the DataSet. I don't see how there can be any data to cause this error.

Does any one have any ideas?

Answer

Are picture Are · Dec 15, 2009

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