DB2BulkCopy.BulkCopyTimeout Property
Number of seconds for the bulk copy operation to complete before it times out.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Property DB2BulkCopyTimeout As Integer
[C#]
public int DB2BulkCopyTimeout {get; set;}
[C++]
public:
property int BulkCopyTimeout {
int get();
void set (int value);
}
[JScript]
public function get DB2BulkCopyTimeout () : int;
public function set DB2BulkCopyTimeout (value : int);
Property value
The integer value of the DB2BulkCopyTimeout property. The default is zero, which means timeout is not set.
Remarks
If a DB2BulkCopyTimeout is provided, it will override the query timeout. Otherwise, the query timeout will take effect.
Example
[C#] The following example demonstrates a bulk copy of data from a DataTable source into the SALES table, using a timeout of 30 seconds.
[C#]
public static void copyIntoSales(DB2Connection conn, DataTable source)
{
DB2BulkCopy salesCopy = new DB2BulkCopy(conn);
salesCopy.DestinationTableName = "SALES";
salesCopy.BulkCopyTimeout = 30;
try
{
salesCopy.WriteToServer(source);
salesCopy.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Exception");
}
}