CopyTo Method (DbLoaderColumnCollection)
The following example exports the
DbLoaderColumnCollection to an array of
Devart.Data.DB2.DB2LoaderColumn 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 DB2LoaderColumnCollection myColumns
// ...
DB2LoaderColumn[] myColumnArray = new DB2LoaderColumn[(2*myColumns.Count) - 1];
myColumns.CopyTo(myColumnArray, 0);
myColumns.CopyTo(myColumnArray, myColumns.Count);
myColumns.Clear();
return true;
}
Public Function DoubleYourColumns() As Boolean
' ...
' create DB2LoaderColumnCollection myColumns
' ...
Dim myColumnArray(2 * myColumns.Count - 1) As DB2LoaderColumn
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