System.Data.Common Namespace DataColumnMapping Class
Returns the current SourceColumn 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 SourceColumn name as a string.
The following example shows using the ToString ( ) method to return the current SourceColumn name.
void AddDataColumnMapping ( DataTableMapping myTableMap ) {
// get column mappings
DataColumnMappingCollection myFieldsMaps = myTableMap.ColumnMappings;
DataColumnMapping myMap = new DataColumnMapping ( "Description", "DataDescription" );
myFieldsMaps.Add ( ( Object ) myMap );
Response.Write ( "column " + myMap.ToString ( ) + " added to " +
"column mapping collection " + myFieldsMaps.ToString ( ) );
}
Public Sub AddDataColumnMapping ( ByVal myTableMap As DataTableMapping )
' get column mappings
Dim myFieldsMaps As DataColumnMappingCollection = myTableMap.ColumnMappings
Dim myMap As New DataColumnMapping ( "Description", "DataDescription" )
myFieldsMaps.Add ( CType ( myMap, Object ) )
Response.Write ( "column " + myMap.ToString ( ) + " added to " _
+ "column mapping collection " + myFieldsMaps.ToString ( ) )
End Sub |
|
C# |
VB |
DataColumnMapping Members