CopyTo Method (DbLoaderColumnCollection)
The following example exports the
DbLoaderColumnCollection to an array of
Devart.Data.MySql.MySqlLoaderColumn objects, doubles the size of the array by using
CopyTo and returns the collection. It then clears the collection, and returns
true if the columns are no longer persisting. This example assumes that a
DbLoaderColumnCollection has already been created.
public bool DoubleYourColumns() {
// ...
// create MySqlLoaderColumnCollection myColumns
// ...
MySqlLoaderColumn[] myColumnArray = new MySqlLoaderColumn[(2*myColumns.Count) - 1];
myColumns.CopyTo(myColumnArray, 0);
myColumns.CopyTo(myColumnArray, myColumns.Count);
myColumns.Clear();
return true;
}
Public Function DoubleYourColumns() As Boolean
' ...
' create MySqlLoaderColumnCollection myColumns
' ...
Dim myColumnArray(2 * myColumns.Count - 1) As MySqlLoaderColumn
myColumns.CopyTo(myColumnArray, 0)
myColumns.CopyTo(myColumnArray, myColumns.Count)
myColumns.Clear()
Return True
End Function 'DoubleYourColumns
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2