System.Data.Common Namespace DataTableMappingCollection Class
Copies the contents of the collection into an Array, starting at the specified index of the Array object.
[ VB ]
NotOverridable Public Sub CopyTo ( _
ByVal array As Array, _
ByVal index As Integer _
)
[ C# ]
public void CopyTo (
Array array,
int index
);
[ C++ ]
public: __sealed void CopyTo (
Array* array,
int index
);
[ JScript ]
public function CopyTo (
array : Array,
index : int
);
- array
- A System.Array object to copy the contents of the collection into.
- index
- The zero-based index of the Array to begin copying the contents of the collection into.
ICollection.CopyTo
Use this method to copy the contents of the DataTableMappingCollection into the specified System.Array object, starting at the specified index.
NOTE: The array parameter must be a zero-based System.Array object.
The following example demonstrates how to use the CopyTo method to copy the contents of the DataTableMappingCollection to an array of DataTableMapping objects.
void copyTo ( DataAdapter myAdapter ) {
DataTableMapping [ ] myArray = new DataTableMapping [ 3 ];
myAdapter.TableMappings.CopyTo ( myArray, 0 );
foreach ( DataTableMapping tableMap in myArray ) {
myLabel.Text += tableMap.SourceTable + "<br>";
}
}
Sub copyTo ( ByVal myAdapter As DataAdapter )
Dim myArray ( 3 ) As DataTableMapping
myAdapter.Tables.CopyTo ( myArray, 0 )
Dim tableMap As DataTableMapping
For Each tableMap In myArray
myLabel.Text &= tableMap.HeaderText & "<br>"
Next table
End Sub |
|
C# |
VB |
DataTableMappingCollection Members