DataTableMapping.ToString Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Converts the current SourceTable name to a string.

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

public override string ToString()

Return Value

Type: System.String

The current SourceTable name, as a string.

The following example creates a DataTableMapping object and adds it to a DataTableMappingCollection collection. It then informs the user that the mapping has been added to the collection and displays the parent mapping.

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());

.NET Framework
Available since 1.1
Return to top