System.Data.Common Namespace DataColumnMappingCollection 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 DataColumnMappingCollection 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 DataColumnMappingCollection to an array of DataColumnMapping objects.
void copyTo ( DataTableMapping myTableMap ) {
DataColumnMapping [ ] myArray = new DataColumnMapping [ 3 ];
myTableMap.ColumnMappings.CopyTo ( myArray, 0 );
foreach ( DataColumnMapping columnMap in myArray ) {
myLabel.Text += columnMap.SourceColumn + "<br>";
}
}
Sub copyTo ( ByVal myTableMap As DataTableMapping )
Dim myArray ( 3 ) As DataColumnMapping
myTableMap.Columns.CopyTo ( myArray, 0 )
Dim columnMap As DataColumnMapping
For Each columnMap In myArray
myLabel.Text &= columnMap.HeaderText & "<br>"
Next column
End Sub |
|
C# |
VB |
DataColumnMappingCollection Members