private bool HasMixedColumns(DataTable table)
{
bool hasAttributes = false;
bool hasElements = false;
foreach (DataColumn col in table.Columns)
{
if (!hasElements && col.ColumnMapping == MappingType.Element)
hasElements = true;
if (!hasAttributes && (col.ColumnMapping == MappingType.Attribute || col.ColumnMapping == MappingType.Hidden))
hasAttributes = !AutoGenerated(col);
if (hasAttributes && hasElements)
return true;
}
return false;
}