System.Data.Common Namespace DataTableMappingCollection Class
Initializes an empty DataTableMappingCollection.
[ VB ]
Public Sub New ( )
[ C# ]
public DataTableMappingCollection ( );
[ C++ ]
public: DataTableMappingCollection ( );
[ JScript ]
public function DataTableMappingCollection ( );
The default constructor initializes all fields to their default values.
The following example initializes a DataTableMappingCollection, adds DataTableMapping objects to the collection, and displays a list of the mapped source tables.
void CreateTableMappings ( ) {
DataTableMappingCollection myTables = new DataTableMappingCollection ( );
myTables.Add ( "Categories", "tblCategories" );
myTables.Add ( "Products", "tblProducts" );
myTables.Add ( "Orders", "tblOrders" );
string myMessage = "Table Mappings:\n";
for ( int i=0; i < myTables.Count; i++ ) {
myMessage += i.ToString ( ) + " " + myTables [ ].ToString ( ) + "\n";
}
Response.Write ( myMessage );
}
Public Sub CreateTableMappings ( )
Dim myTables As New DataTableMappingCollection ( )
myTables.Add ( "Categories", "tblCategories" )
myTables.Add ( "Products", "tblProducts" )
myTables.Add ( "Orders", "tblOrders" )
Dim myMessage As String = "Table Mappings:" + ControlChars.Cr
Dim i As Integer
For i = 0 To myTables.Count - 1
myMessage += i.ToString ( ) + " " + myTables ( i ).ToString ( ) + ControlChars.Cr
Next i
Response.Write ( myMessage )
End Sub |
|
C# |
VB |
DataTableMappingCollection Members