You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
290
-
</exception>
289
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
295
+
</exception>
291
296
<exceptioncref="T:System.IO.IOException">
292
297
An error occurred in a
293
298
<seecref="T:System.IO.Stream" />
@@ -399,8 +404,13 @@ To set up this example, create a new Windows application. Put a <xref:System.Win
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
403
-
</exception>
407
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
413
+
</exception>
404
414
</BeginExecuteNonQuery>
405
415
<BeginExecuteReadername="default">
406
416
<summary>
@@ -477,8 +487,13 @@ The following console application starts the process of retrieving a data reader
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
481
-
</exception>
490
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
496
+
</exception>
482
497
<exceptioncref="T:System.IO.IOException">
483
498
An error occurred in a
484
499
<seecref="T:System.IO.Stream" />
@@ -584,8 +599,13 @@ This example also passes the `CommandBehavior.CloseConnection` and `CommandBehav
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
588
-
</exception>
602
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
608
+
</exception>
589
609
<exceptioncref="T:System.IO.IOException">
590
610
An error occurred in a
591
611
<seecref="T:System.IO.Stream" />
@@ -702,8 +722,13 @@ To set up this example, create a new Windows application. Put a <xref:System.Win
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
706
-
</exception>
725
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
731
+
</exception>
707
732
<exceptioncref="T:System.IO.IOException">
708
733
An error occurred in a
709
734
<seecref="T:System.IO.Stream" />
@@ -831,8 +856,13 @@ This example passes the `CommandBehavior.CloseConnection` value in the `behavior
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
835
-
</exception>
859
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
865
+
</exception>
836
866
<exceptioncref="T:System.IO.IOException">
837
867
An error occurred in a
838
868
<seecref="T:System.IO.Stream" />
@@ -940,6 +970,11 @@ The following console application starts the process of retrieving XML data asyn
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
943
978
</exception>
944
979
<exceptioncref="T:System.IO.IOException">
945
980
An error occurred in a
@@ -1067,8 +1102,13 @@ To set up this example, create a new Windows application. Put a <xref:System.Win
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
1071
-
</exception>
1105
+
closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
is set to true and a parameter with direction Output or InputOutput has been added to the <seecref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
1111
+
</exception>
1072
1112
<exceptioncref="T:System.IO.IOException">
1073
1113
An error occurred in a
1074
1114
<seecref="T:System.IO.Stream" />
@@ -1343,6 +1383,33 @@ The <xref:Microsoft.Data.SqlClient.SqlCommand.CreateParameter%2A> method is a st
1343
1383
To be added.
1344
1384
</remarks>
1345
1385
</Dispose>
1386
+
<EnableOptimizedParameterBinding>
1387
+
<summary>
1388
+
Gets or sets a value indicating whether the command object should optimize parameter performance by disabling Output and InputOutput directions when submitting the command to the SQL Server.
1389
+
</summary>
1390
+
<value>
1391
+
A value indicating whether the command object should optimize parameter performance by disabling Output and InputOuput parameter directions when submitting the command to the SQL Server.
1392
+
The default is <seelangword="false" />.
1393
+
</value>
1394
+
<remarks>
1395
+
<formattype="text/markdown">
1396
+
<![CDATA[
1397
+
## Remarks
1398
+
You must set the value for this property before the command is executed for it to take effect.
1399
+
1400
+
When a command is submitted to the server with parameters a list of the parameter names is sent as part of the submission. The list is used on the server to match Output and InputOutput parameters to the results of the query execution so that the values can be returned to the caller. This option disables the construction and submission of the parameter name list and as a consequence disables the use of Output and InputOutput parameters. The return parameter is not affected by this option.
1401
+
1402
+
A command sent with this option changes the way parameters are handled on the server, because there is no need to maintain an output parameter map. The result of this change is that queries with large numbers of input parameters may execute much faster.
1403
+
1404
+
The fewest number of parameters where this will take effect depends on the individual situation and should be detected by measuring query duration with and without the option enabled. Any query with more than 24 parameters may show lower overall query duration. Queries with parameter counts lower than 24 are unlikely to show a difference.
1405
+
1406
+
> [!NOTE]
1407
+
If the option is enabled and a parameter with Direction Output or InputOutput is present in the Parameters collection an InvalidOperationException will be thrown when the command is executed.
0 commit comments