Closes the DB2BulkCopy instance.
[Visual Basic]
Public Sub Close
[C#]
public void Close ()
[C++]
public:
void Close ()
[JScript]
public function Close ()
After you call Close on a DB2BulkCopy instance, no other operation will succeed. Any actions involving members of a DB2BulkCopy instance after running Close will result in the data provider throwing an InvalidOperationException.
[C#] The following example demonstrates a bulk copy of data from a DataTable source into the SALES table.
[C#]
public static void copyIntoSales(DB2Connection conn, DataTable source)
{
DB2BulkCopy salesCopy = new DB2BulkCopy(conn);
salesCopy.DestinationTableName = "SALES";
try
{
salesCopy.WriteToServer(source);
salesCopy.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Exception");
}
}