Export (0) Print
Expand All

SqlBulkCopy.BulkCopyTimeout Property

Number of seconds for the operation to complete before it times out.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

public:
property int BulkCopyTimeout {
	int get ();
	void set (int value);
}
/** @property */
public int get_BulkCopyTimeout ()

/** @property */
public void set_BulkCopyTimeout (int value)

public function get BulkCopyTimeout () : int

public function set BulkCopyTimeout (value : int)

Not applicable.

Property Value

The integer value of the BulkCopyTimeout property.

If the operation does time out, the transaction is not committed and all copied rows are removed from the destination table.

The following console application demonstrates how to modify the default time-out setting of 30 seconds when bulk loading data.

In this example, the source data is first read from a SQL Server table to a SqlDataReader instance. The source data does not have to be located on SQL Server; you can use any data source that can be read to an IDataReader or loaded to a DataTable.

NoteImportant:

This sample will not run unless you have created the work tables as described in Creating Tables for the Bulk Copy Examples. This code is provided to demonstrate the syntax for using SqlBulkCopy only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL INSERT … SELECT statement to copy the data.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft