Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to include note about existing issues with Async APIs #2118

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions doc/snippets/Microsoft.Data.SqlClient/SqlCommand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,11 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and t

## Remarks
For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).

> [!NOTE]
> For long running queries on server, you should consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> due to a known issue with canceling queries with cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
cheenamalhotra marked this conversation as resolved.
Show resolved Hide resolved


]]></format>
</remarks>
<exception cref="T:System.InvalidCastException">
Expand Down Expand Up @@ -1986,6 +1991,10 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, and

## Remarks
For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).

> [!NOTE]
> For long running queries on server, you should consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> due to a known issue with canceling queries with cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
cheenamalhotra marked this conversation as resolved.
Show resolved Hide resolved

]]></format>
</remarks>
<exception cref="T:System.InvalidCastException">
Expand Down Expand Up @@ -2466,6 +2475,10 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and t

## Remarks
For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).

> [!NOTE]
> For long running queries on server, you should consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> due to a known issue with canceling queries with cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
cheenamalhotra marked this conversation as resolved.
Show resolved Hide resolved

]]></format>
</remarks>
<exception cref="T:System.InvalidCastException">
Expand Down Expand Up @@ -2657,6 +2670,10 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and t
## Remarks
The **XmlReader** returned by this method does not support asynchronous operations.
For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).

> [!NOTE]
> For long running queries on server, you should consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> due to a known issue with canceling queries with cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
cheenamalhotra marked this conversation as resolved.
Show resolved Hide resolved

]]></format>
</remarks>
<exception cref="T:System.InvalidCastException">
Expand Down
4 changes: 4 additions & 0 deletions doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,10 @@
If the `behavior` parameter of <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync%2A> is set to `Default`, <xref:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync%2A> reads the entire row before returning the Task.

For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).

> [!NOTE]
> When reading large data (binary/text), it is recommended to use <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> for optimal performance.


]]></format>
</remarks>
Expand Down