共用方式為


DataTableMapping.ToString 方法

定義

將目前的 SourceTable 名稱轉換為字串。

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

傳回

目前的 SourceTable 名稱,做為字串。

範例

下列範例會 DataTableMapping 建立 物件,並將它新增至 DataTableMappingCollection 集合。 然後,它會通知使用者已將對應新增至集合,並顯示父對應。

public void AddDataTableMapping()
{
    // ...
    // create mappings
    // ...
    DataTableMapping mapping =
        new DataTableMapping("Categories","DataCategories");
    mappings.Add((Object) mapping);
    Console.WriteLine("Table " + mapping.ToString() + " added to " +
        "table mapping collection " + mappings.ToString());
}
Public Sub AddDataTableMapping()
    ' ...
    ' create mappings
    ' ...
    Dim mapping As New DataTableMapping("Categories", "DataCategories")
    mappings.Add(CType(mapping, Object))
    Console.WriteLine("Table " & mapping.ToString() & " added to " _
       & "table mapping collection " & mappings.ToString())
End Sub

適用於

另請參閱