MappingType MappingType MappingType MappingType Enum

定义

指定如何映射 DataColumnSpecifies how a DataColumn is mapped.

public enum class MappingType
[System.Serializable]
public enum MappingType
type MappingType = 
Public Enum MappingType
继承
属性

字段

Attribute Attribute Attribute Attribute 2

将列映射到 XML 特性。The column is mapped to an XML attribute.

Element Element Element Element 1

将列映射到 XML 元素。The column is mapped to an XML element.

Hidden Hidden Hidden Hidden 4

将列映射到内部结构。The column is mapped to an internal structure.

SimpleContent SimpleContent SimpleContent SimpleContent 3

将列映射到 XmlText 节点。The column is mapped to an XmlText node.

示例

下面的示例返回表ColumnMapping中每一列的属性值。The following example returns the ColumnMapping property value for each column in a table.

static private void GetColumnMapping(DataTable dataTable)
{
    foreach (DataColumn dataColumn in dataTable.Columns)
    {
        Console.WriteLine(dataColumn.ColumnMapping.ToString());
    }
}
Private Sub GetColumnMapping(ByVal dataTable As DataTable)
    Dim dataColumn As DataColumn
    For Each dataColumn In dataTable.Columns
        Console.WriteLine(dataColumn.ColumnMapping.ToString())
    Next dataColumn
End Sub

注解

DataColumn获取或ColumnMapping设置的属性时, 将使用枚举。MappingTypeThe MappingType enumeration is used when getting or setting the ColumnMapping property of the DataColumn. WriteXmlDataSet在上调用方法来将数据和架构作为 XML 文档写入时, 属性确定如何编写列的值。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.

适用于