System.Data.Common Namespace DataColumnMappingCollection Class
Initializes an empty DataColumnMappingCollection.
[ VB ]
Public Sub New ( )
[ C# ]
public DataColumnMappingCollection ( );
[ C++ ]
public: DataColumnMappingCollection ( );
[ JScript ]
public function DataColumnMappingCollection ( );
The default constructor initializes all fields to their default values.
The following example initializes a DataColumnMappingCollection, adds DataColumnMapping objects to the collection, and displays a list of the mapped source columns.
void CreateColumnMappings ( ) {
DataColumnMappingCollection myFieldsMaps = new DataColumnMappingCollection ( );
myFieldsMaps.Add ( "Category Name", "DataCategory" );
myFieldsMaps.Add ( "Description", "DataDescription" );
myFieldsMaps.Add ( "Picture", "DataPicture" );
string myMessage = "Column Mappings:\n";
for ( int i=0; i < myFieldsMaps.Count; i++ ) {
myMessage += i.ToString ( ) + " " + myFieldsMaps [ ].ToString ( ) + "\n";
}
Response.Write ( myMessage );
}
Public Sub CreateColumnMappings ( )
Dim myFieldsMaps As New DataColumnMappingCollection ( )
myFieldsMaps.Add ( "Category Name", "DataCategory" )
myFieldsMaps.Add ( "Description", "DataDescription" )
myFieldsMaps.Add ( "Picture", "DataPicture" )
Dim myMessage As String = "Column Mappings:" + ControlChars.Cr
Dim i As Integer
For i = 0 To myFieldsMaps.Count - 1
myMessage += i.ToString ( ) + " " + myFieldsMaps ( i ).ToString ( ) + ControlChars.Cr
Next i
Response.Write ( myMessage )
End Sub |
|
C# |
VB |
DataColumnMappingCollection Members