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 屬性 (Attribute)。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

備註

MappingType取得或ColumnMapping設定的屬性DataColumn時, 會使用列舉型別。The MappingType enumeration is used when getting or setting the ColumnMapping property of the DataColumn. 屬性會決定在WriteXml DataSet上呼叫方法時, 要如何寫入資料行的值, 以將資料和架構當做 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.

適用於