Hi folks,

I've run into what looks like a 1.0/1.1 bug in the DataTable that's
preventing me from doing Xml serialization from a DataSet. Essentially it
seems the the internal ElementColumnCount property of the DataTable isn't
reset when the DataTable's columns collection is reset. This makes it
impossible to set any column's ColumnMapping to MappingType.SimpleContent
after the collection has been cleared.

Example:

DataSet ds = new DataSet();
ds.Tables.Add();

ds.Tables[0].Columns.Add("ColumnA", typeof(int));
ds.Tables[0].Columns.Clear();

ds.Tables[0].Columns.Add("ColumnB", typeof(int));

// next line throws an exception even though it is the only column in the
table
ds.Tables[0].Columns["ColumnB"].ColumnMapping = MappingType.SimpleContent;

This is causing me a few probs because I want to merge two typed datasets
and generate xml from the merged DS. The merging process involves a clone,
which in turn involves instantiating a new datatable (automatically creating
the relevant columns for a typed DS), clearing the column collection and
then recreating the columns.

Have I missed something, or is there a workaround that could get me past
this?

thanks for the help,
Michael