共用方式為


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

適用於

另請參閱