A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopy.writetoserverasync below:

SqlBulkCopy.WriteToServerAsync Method (System.Data.SqlClient) | Microsoft Learn

SqlBulkCopy.WriteToServerAsync Method Definition Overloads WriteToServerAsync(IDataReader, CancellationToken)

The asynchronous version of WriteToServer(IDataReader), which copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

WriteToServerAsync(DbDataReader)

The asynchronous version of WriteToServer(DbDataReader), which copies all rows from the supplied DbDataReader array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(DataRow[])

The asynchronous version of WriteToServer(DataRow[]), which copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(DataTable)

The asynchronous version of WriteToServer(DataTable), which copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(IDataReader)

The asynchronous version of WriteToServer(IDataReader), which copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(DbDataReader, CancellationToken)

The asynchronous version of WriteToServer(DbDataReader), which copies all rows from the supplied DbDataReader array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(DataRow[], CancellationToken)

The asynchronous version of WriteToServer(DataRow[]), which copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

WriteToServerAsync(DataTable, DataRowState)

The asynchronous version of WriteToServer(DataTable, DataRowState), which copies only rows that match the supplied row state in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

WriteToServerAsync(DataTable, CancellationToken)

The asynchronous version of WriteToServer(DataTable), which copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

WriteToServerAsync(DataTable, DataRowState, CancellationToken)

The asynchronous version of WriteToServer(DataTable, DataRowState), which copies only rows that match the supplied row state in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

If multiple active result sets (MARS) is disabled, WriteToServer makes the connection busy. If MARS is enabled, you can interleave calls to WriteToServer with other commands in the same connection.

The number of rows that are rolled back when one fails depends on several things:

When there is an error while sending data to the server, the current batch (as specified by BatchSize) will be rolled back. If UseInternalTransaction is not specified and you have your own transaction, the entire transaction will be rolled back (which includes all previous batches as well).

Use SqlRowsCopied to know how many rows were copied to the server.

WriteToServerAsync(IDataReader, CancellationToken)
Source:
System.Data.SqlClient.notsupported.cs

The asynchronous version of WriteToServer(IDataReader), which copies all rows in the supplied IDataReader to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::IDataReader ^ reader, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.IDataReader reader, System.Threading.CancellationToken cancellationToken);
member this.WriteToServerAsync : System.Data.IDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (reader As IDataReader, cancellationToken As CancellationToken) As Task
Parameters Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(IDataReader).

WriteToServerAsync(DbDataReader)
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::Common::DbDataReader ^ reader);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.Common.DbDataReader reader);
member this.WriteToServerAsync : System.Data.Common.DbDataReader -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (reader As DbDataReader) As Task
Parameters Returns

A task representing the asynchronous operation.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DbDataReader).

WriteToServerAsync(DataRow[])
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(cli::array <System::Data::DataRow ^> ^ rows);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataRow[] rows);
member this.WriteToServerAsync : System.Data.DataRow[] -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (rows As DataRow()) As Task
Parameters
rows
DataRow[]

An array of DataRow objects that will be copied to the destination table.

Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataRow[]).

WriteToServerAsync(DataTable)
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::DataTable ^ table);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataTable table);
member this.WriteToServerAsync : System.Data.DataTable -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (table As DataTable) As Task
Parameters Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataTable).

WriteToServerAsync(IDataReader)
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::IDataReader ^ reader);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.IDataReader reader);
member this.WriteToServerAsync : System.Data.IDataReader -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (reader As IDataReader) As Task
Parameters Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(IDataReader).

WriteToServerAsync(DbDataReader, CancellationToken)
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::Common::DbDataReader ^ reader, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken cancellationToken);
member this.WriteToServerAsync : System.Data.Common.DbDataReader * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (reader As DbDataReader, cancellationToken As CancellationToken) As Task
Parameters Returns

Returns Task.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DbDataReader).

WriteToServerAsync(DataRow[], CancellationToken)
Source:
System.Data.SqlClient.notsupported.cs

The asynchronous version of WriteToServer(DataRow[]), which copies all rows from the supplied DataRow array to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(cli::array <System::Data::DataRow ^> ^ rows, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataRow[] rows, System.Threading.CancellationToken cancellationToken);
member this.WriteToServerAsync : System.Data.DataRow[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (rows As DataRow(), cancellationToken As CancellationToken) As Task
Parameters
rows
DataRow[]

An array of DataRow objects that will be copied to the destination table.

Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataRow[]).

WriteToServerAsync(DataTable, DataRowState)
Source:
System.Data.SqlClient.notsupported.cs
public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::DataTable ^ table, System::Data::DataRowState rowState);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataTable table, System.Data.DataRowState rowState);
member this.WriteToServerAsync : System.Data.DataTable * System.Data.DataRowState -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (table As DataTable, rowState As DataRowState) As Task
Parameters
rowState
DataRowState

A value from the DataRowState enumeration. Only rows matching the row state are copied to the destination.

Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataTable, DataRowState).

WriteToServerAsync(DataTable, CancellationToken)
Source:
System.Data.SqlClient.notsupported.cs

The asynchronous version of WriteToServer(DataTable), which copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::DataTable ^ table, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataTable table, System.Threading.CancellationToken cancellationToken);
member this.WriteToServerAsync : System.Data.DataTable * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (table As DataTable, cancellationToken As CancellationToken) As Task
Parameters Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataTable).

WriteToServerAsync(DataTable, DataRowState, CancellationToken)
Source:
System.Data.SqlClient.notsupported.cs

The asynchronous version of WriteToServer(DataTable, DataRowState), which copies only rows that match the supplied row state in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.

The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.

public:
 System::Threading::Tasks::Task ^ WriteToServerAsync(System::Data::DataTable ^ table, System::Data::DataRowState rowState, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WriteToServerAsync(System.Data.DataTable table, System.Data.DataRowState rowState, System.Threading.CancellationToken cancellationToken);
member this.WriteToServerAsync : System.Data.DataTable * System.Data.DataRowState * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WriteToServerAsync (table As DataTable, rowState As DataRowState, cancellationToken As CancellationToken) As Task
Parameters
rowState
DataRowState

A value from the DataRowState enumeration. Only rows matching the row state are copied to the destination.

Returns

A task representing the asynchronous operation.

Exceptions

Returned in the task object, any error returned by SQL Server that occurred while opening the connection.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see Asynchronous Programming.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteToServer(DataTable, DataRowState).

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4