public TableMapping (DataTable dt)
{
existsInDataSet = true;
Table = dt;
foreach (DataColumn col in dt.Columns) {
switch (col.ColumnMapping) {
case MappingType.Element:
Elements.Add (col);
break;
case MappingType.Attribute:
Attributes.Add (col);
break;
case MappingType.SimpleContent:
SimpleContent = col;
break;
}
}
PrimaryKey = dt.PrimaryKey.Length > 0 ? dt.PrimaryKey [0] : null;
}