Edit

Share via


MappingType Enum

Definition

Specifies how a DataColumn is mapped.

C#
public enum MappingType
C#
[System.Serializable]
public enum MappingType
Inheritance
MappingType
Attributes

Fields

Name Value Description
Element 1

The column is mapped to an XML element.

Attribute 2

The column is mapped to an XML attribute.

SimpleContent 3

The column is mapped to an XmlText node.

Hidden 4

The column is mapped to an internal structure.

Examples

The following example returns the ColumnMapping property value for each column in a table.

C#
static private void GetColumnMapping(DataTable dataTable)
{
    foreach (DataColumn dataColumn in dataTable.Columns)
    {
        Console.WriteLine(dataColumn.ColumnMapping.ToString());
    }
}

Remarks

The MappingType enumeration is used when getting or setting the ColumnMapping property of the DataColumn. The property determines how a column's values will be written when the WriteXml method is called on a DataSet to write the data and schema out as an XML document.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1