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

适用于

另请参阅