DataColumnMapping.ToString 方法

定义

将当前的 SourceColumn 名称转换为字符串。

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

当前的 SourceColumn 名称作为字符串。

示例

以下示例创建 一个 DataColumnMapping 对象并将其添加到 DataColumnMappingCollection 集合中。 然后,它会告知用户映射已添加到集合中,并显示映射的父级。


public void AddDataColumnMapping() {
   // ...
   // create columnMappings
   // ...
   DataColumnMapping mapping =
      new DataColumnMapping("Description","DataDescription");
   columnMappings.Add((Object) mapping);
   Console.WriteLine("Column {0} added to column mapping collection {1}.",
       mapping.ToString(), columnMappings.ToString());
}
Public Sub AddDataColumnMapping()
    ' ...
    ' create columnMappings
    ' ...
    Dim mapping As New DataColumnMapping( _
       "Description", "DataDescription")
    columnMappings.Add(CType(mapping, Object))
    Console.WriteLine("Column {0} added to column mapping collection {1}.", _
       mapping.ToString(), columnMappings.ToString())
End Sub

适用于

另请参阅