Skip to content

Commit

Permalink
Update docs to include note about existing issues with Async APIs (#2118
Browse files Browse the repository at this point in the history
)
  • Loading branch information
cheenamalhotra committed Aug 11, 2023
1 parent 930133e commit b82b1eb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
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 the server, consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> due to a known issue with canceling queries via a cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
]]></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 the server, consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> due to a known issue with canceling queries via a cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
]]></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 the server, consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> due to a known issue with canceling queries via a cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
]]></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 the server, consider using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> due to a known issue with canceling queries via a cancellation token. Also, consider canceling execution using the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
]]></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

0 comments on commit b82b1eb

Please sign in to comment.