System.Data.SqlClient.SqlBulkCopy.Close Method

Closes the System.Data.SqlClient.SqlBulkCopy instance.

Syntax

public void Close ()

Remarks

After you call a SqlBulkCopy.Close on the System.Data.SqlClient.SqlBulkCopy object, no other operation will succeed. Calls to the erload:System.Data.SqlClient.SqlBulkCopy.WriteToServer method will throw an InvalidOperationException.

Calling the SqlBulkCopy.Close method from the SqlBulkCopy.SqlRowsCopied event causes an InvalidOperationException to be thrown.

Note that open System.Data.SqlClient.SqlBulkCopy instances are closed implicitly at the end of a using block.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 2.0.0.0