| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DataTableMappingCollection ClassRepresents a collection of DataTableMapping objects for a DataAdapter.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Visibility | Name | Value Type | Accessibility |
|---|---|---|---|
| public | Count | Int32 | [ Get ] |
| public | Item ( String sourceTable ) | DataTableMapping | [ Get , Set ] |
| public | Item ( Int32 index ) | DataTableMapping | [ Get , Set ] |
| Visibility | Name | Parameters | Return Type |
|---|---|---|---|
| public | Add | ( String sourceTable , String dataSetTable ) | DataTableMapping |
| public | Add | ( Object value ) | Int32 |
| public | AddRange | ( DataTableMapping values ) | Void |
| public | AddRange | ( Array values ) | Void |
| public | Clear | ( ) | Void |
| public | Contains | ( Object value ) | Boolean |
| public | Contains | ( String value ) | Boolean |
| public | CopyTo | ( DataTableMapping array , Int32 index ) | Void |
| public | CopyTo | ( Array array , Int32 index ) | Void |
| public | GetByDataSetTable | ( String dataSetTable ) | DataTableMapping |
| public | GetEnumerator | ( ) | IEnumerator |
| public static | GetTableMappingBySchemaAction | ( DataTableMappingCollection tableMappings , String sourceTable , String dataSetTable , MissingMappingAction mappingAction ) | DataTableMapping |
| public | IndexOf | ( Object value ) | Int32 |
| public | IndexOf | ( String sourceTable ) | Int32 |
| public | IndexOfDataSetTable | ( String dataSetTable ) | Int32 |
| public | Insert | ( Int32 index , DataTableMapping value ) | Void |
| public | Insert | ( Int32 index , Object value ) | Void |
| public | Remove | ( DataTableMapping value ) | Void |
| public | Remove | ( Object value ) | Void |
| public | RemoveAt | ( Int32 index ) | Void |
| public | RemoveAt | ( String sourceTable ) | Void |
The DataTableMappingCollection contains the collection of DataTableMapping objects that link the tables in a DataSet to those in a data source. This collection is accessed via the DataAdapter.TableMappings property.
Like most data collections in ADO.NET, the DataTableMappingCollection uses standard collection methods to manage the items in the collection. These include the methods Add, Clear, and Remove.
The collection also includes a Count property to determine how many DataColumn objects are in the collection, and a Contains method to verify whether a specified column mapping exists in the collection.
The following example demonstrates using the TableMappings property to print the values of each DataTableMapping object in the collection.
void getTableMappings ( DataAdapter myAdapter ) {
// get table mappings
DataTableMappingCollection myTables = myAdapter.TableMappings;
string myMessage = "Table Mappings:\n";
for ( int i=0; i < myTables.Count; i++ ) {
myMessage += i.ToString ( ) + " " + myTables [ ].ToString ( ) + "\n";
}
Response.Write ( myMessage );
}
| ||
| C# | VB | |
TableMappings DataTableMapping
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme