DB2®BulkCopy.WriteToServer(System.Data.DataRow[ ]) Method
Copies all rows from the DataRow array to a destination table specified by the DestinationTableName property.
- Namespace:
IBM.Data.DB2- Assembly:
IBM.Data.DB2(inIBM.Data.DB2.dll)
Syntax
[Visual Basic]
Public Sub WriteToServer ( dataRows As DataRow() )
[C#]
public void WriteToServer ( DataRow[] dataRows )
[C++]
public:
void WriteToServer ( array<DataRow*>* dataRows )
[JScript]
public function WriteToServer ( dataRows : DataRow[] )
Parameters
- dataRows
- An array of DataRow objects to copy to the destination table.
Example
[C#] The following example demonstrates a bulk copy of data from an array of DataRow objects into the SALES table.
[C#]
public static void copyIntoSales(DB2Connection conn, DataRow [] source)
{
DB2BulkCopy salesCopy = new DB2BulkCopy(conn);
salesCopy.DestinationTableName = "SALES";
try
{
salesCopy.WriteToServer(source);
salesCopy.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Exception");
}
}