System.Data.Common Namespace DataTableMapping Class
Returns the current SourceTable name as a string.
[ VB ]
Overrides Public Function ToString ( ) As String
[ C# ]
public override string ToString ( );
[ C++ ]
public: String* ToString ( );
[ JScript ]
public override function ToString ( ) : String;
The current SourceTable name as a string.
The following example shows using the ToString ( ) method to return the current SourceTable name.
void AddDataTableMapping ( DataAdapter myAdapter ) {
// get table mappings
DataTableMappingCollection myTables = myAdapter.TableMappings;
DataTableMapping myTable = new DataTableMapping ( "Description", "DataDescription" );
myTables.Add ( ( Object ) myTable );
Response.Write ( "Table " + myTable.ToString ( ) + " added to " +
"table mapping collection " + myTables.ToString ( ) );
}
Public Sub AddDataAdapter ( ByVal myAdapter As DataAdapter )
' get table mappings
Dim myTables As DataTableMappingCollection = myAdapter.TableMappings
Dim myTable As New DataTableMapping ( "Description", "DataDescription" )
myTables.Add ( CType ( myTable, Object ) )
Response.Write ( "Table " + myTable.ToString ( ) + " added to " _
+ "table mapping collection " + myTables.ToString ( ) )
End Sub |
|
C# |
VB |
DataTableMapping Members