1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="SqlCommand" FullName="System.Data.SqlClient.SqlCommand">
<TypeSignature Language="C#" Maintainer="auto" Value="public sealed class SqlCommand : System.Data.Common.DbCommand, ICloneable" />
<AssemblyInfo>
<AssemblyName>System.Data</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
<AssemblyVersion>1.0.3300.0</AssemblyVersion>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
<Base>
<BaseTypeName>System.Data.Common.DbCommand</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("RecordsAffected")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.ToolboxItem("System.Drawing.Design.ToolboxItem, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Designer("Microsoft.VSDesigner.Data.VS.SqlCommandDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When an instance of <see cref="T:System.Data.SqlClient.SqlCommand" /> is created, the read/write properties are set to their initial values. For a list of these values, see the <see cref="T:System.Data.SqlClient.SqlCommand" /> constructor.</para>
<para>
<see cref="T:System.Data.SqlClient.SqlCommand" /> features the following methods for executing commands at a SQL Server database: </para>
<list type="table">
<listheader>
<item>
<term>
<para>Item </para>
</term>
<description>
<para>Description </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
</para>
</term>
<description>
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />, generally executing commands such as INSERT, DELETE, UPDATE, and SET statements. Each call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> must be paired with a call to <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> which finishes the operation, typically on a separate thread.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" />
</para>
</term>
<description>
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" /> and retrieves one or more results sets from the server. Each call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> must be paired with a call to <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> which finishes the operation, typically on a separate thread.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
</para>
</term>
<description>
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />. Each call to BeginExecuteXmlReader must be paired with a call to EndExecuteXmlReader, which finishes the operation, typically on a separate thread, and returns an <see cref="T:System.Xml.XmlReader" /> object.</para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> </para>
</term>
<description>
<para>Executes commands that return rows. For increased performance, <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> invokes commands using the Transact-SQL sp_executesql system stored procedure. Therefore, <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> might not have the effect that you want if used to execute commands such as Transact-SQL SET statements. </para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.ExecuteNonQuery" /> </para>
</term>
<description>
<para>Executes commands such as Transact-SQL INSERT, DELETE, UPDATE, and SET statements. </para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.ExecuteScalar" /> </para>
</term>
<description>
<para>Retrieves a single value (for example, an aggregate value) from a database. </para>
</description>
</item>
<item>
<term>
<para>
<see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> </para>
</term>
<description>
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> and builds an <see cref="T:System.Xml.XmlReader" /> object. </para>
</description>
</item>
</list>
<para>You can reset the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property and reuse the <see cref="T:System.Data.SqlClient.SqlCommand" /> object. However, you must close the <see cref="T:System.Data.SqlClient.SqlDataReader" /> before you can execute a new or previous command.</para>
<para>If a <see cref="T:System.Data.SqlClient.SqlException" /> is generated by the method executing a <see cref="T:System.Data.SqlClient.SqlCommand" />, the <see cref="T:System.Data.SqlClient.SqlConnection" /> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the <see cref="T:System.Data.SqlClient.SqlConnection" />. However, the user can reopen the connection and continue.</para>
<block subset="none" type="note">
<para>Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlCommand ();" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The base constructor initializes all fields to their default values. The following table shows initial property values for an instance of <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Properties </para>
</term>
<description>
<para>Initial value </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> </para>
</term>
<description>
<para>empty string ("") </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> </para>
</term>
<description>
<para>30 </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> </para>
</term>
<description>
<para>CommandType.Text </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> </para>
</term>
<description>
<para>Null </para>
</description>
</item>
</list>
<para>You can change the value for any of these properties through a separate call to the property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlCommand (string cmdText);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="cmdText" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When an instance of <see cref="T:System.Data.SqlClient.SqlCommand" /> is created, the following read/write properties are set to initial values.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Properties </para>
</term>
<description>
<para>Initial value </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> </para>
</term>
<description>
<para>
<paramref name="cmdText" /> </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> </para>
</term>
<description>
<para>30 </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> </para>
</term>
<description>
<para>CommandType.Text </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> </para>
</term>
<description>
<para>null </para>
</description>
</item>
</list>
<para>You can change the value for any of these properties through a separate call to the property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class with the text of the query.</para>
</summary>
<param name="cmdText">
<attribution license="cc4" from="Microsoft" modified="false" />The text of the query. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlCommand (string cmdText, System.Data.SqlClient.SqlConnection connection);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="cmdText" Type="System.String" />
<Parameter Name="connection" Type="System.Data.SqlClient.SqlConnection" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The following table shows initial property values for an instance of <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Properties </para>
</term>
<description>
<para>Initial value </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> </para>
</term>
<description>
<para>
<paramref name="cmdText" /> </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> </para>
</term>
<description>
<para>30 </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> </para>
</term>
<description>
<para>CommandType.Text </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> </para>
</term>
<description>
<para>A new <see cref="T:System.Data.SqlClient.SqlConnection" /> that is the value for the <paramref name="connection" /> parameter. </para>
</description>
</item>
</list>
<para>You can change the value for any of these parameters by setting the related property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class with the text of the query and a <see cref="T:System.Data.SqlClient.SqlConnection" />.</para>
</summary>
<param name="cmdText">
<attribution license="cc4" from="Microsoft" modified="false" />The text of the query. </param>
<param name="connection">
<attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Data.SqlClient.SqlConnection" /> that represents the connection to an instance of SQL Server. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlCommand (string cmdText, System.Data.SqlClient.SqlConnection connection, System.Data.SqlClient.SqlTransaction transaction);" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters>
<Parameter Name="cmdText" Type="System.String" />
<Parameter Name="connection" Type="System.Data.SqlClient.SqlConnection" />
<Parameter Name="transaction" Type="System.Data.SqlClient.SqlTransaction" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The following table shows initial property values for an instance of <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
<list type="table">
<listheader>
<item>
<term>
<para>Properties </para>
</term>
<description>
<para>Initial value </para>
</description>
</item>
</listheader>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> </para>
</term>
<description>
<para>
<paramref name="cmdText" /> </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> </para>
</term>
<description>
<para>30 </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> </para>
</term>
<description>
<para>CommandType.Text </para>
</description>
</item>
<item>
<term>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> </para>
</term>
<description>
<para>A new <see cref="T:System.Data.SqlClient.SqlConnection" /> that is the value for the <paramref name="connection" /> parameter. </para>
</description>
</item>
</list>
<para>You can change the value for any of these parameters by setting the related property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class with the text of the query, a <see cref="T:System.Data.SqlClient.SqlConnection" />, and the <see cref="T:System.Data.SqlClient.SqlTransaction" />.</para>
</summary>
<param name="cmdText">
<attribution license="cc4" from="Microsoft" modified="false" />The text of the query. </param>
<param name="connection">
<attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Data.SqlClient.SqlConnection" /> that represents the connection to an instance of SQL Server. </param>
<param name="transaction">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Data.SqlClient.SqlTransaction" /> in which the <see cref="T:System.Data.SqlClient.SqlCommand" /> executes. </param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="BeginExecuteNonQuery">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteNonQuery ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method starts the process of asynchronously executing a tsql statement or stored procedure that does not return rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> method to finish the operation. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method returns immediately (<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> has no effect on <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />), but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous.</para>
<para>Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <see cref="P:System.IAsyncResult.IsCompleted" /> property of the <see cref="T:System.IAsyncResult" /> returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method; or wait for the completion of one or more commands using the <see cref="P:System.IAsyncResult.AsyncWaitHandle" /> property of the returned <see cref="T:System.IAsyncResult" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll or wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />, which returns the number of affected rows.</para>
</returns>
</Docs>
</Member>
<Member MemberName="BeginExecuteNonQuery">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteNonQuery (AsyncCallback callback, object stateObject);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that does not return rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> method to finish the operation. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method returns immediately (<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> has no effect on <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(System.AsyncCallback,System.Object)" />), but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <paramref name="callback" /> parameter lets you specify an <see cref="T:System.AsyncCallback" /> delegate that is called when the statement has completed. You can call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the <paramref name="asyncStateObject" /> parameter, and your callback procedure can retrieve this information using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous.</para>
<para>Because the callback procedure executes from within a background thread supplied by the Microsoft .NET common language runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure; should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.</para>
<para>All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />, given a callback procedure and state information.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll or wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />, which returns the number of affected rows.</para>
</returns>
<param name="callback">
<attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.AsyncCallback" /> delegate that is invoked when the command's execution has completed. Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.</param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</param>
</Docs>
</Member>
<Member MemberName="BeginExecuteReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteReader ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method to finish the operation and retrieve the <see cref="T:System.Data.SqlClient.SqlDataReader" /> returned by the command. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method returns immediately, but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> may block if more data is required and the underlying network's read operation blocks.</para>
<para>Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <see cref="P:System.IAsyncResult.IsCompleted" /> property of the <see cref="T:System.IAsyncResult" /> returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method; or wait for the completion of one or more commands using the <see cref="P:System.IAsyncResult.AsyncWaitHandle" /> property of the returned <see cref="T:System.IAsyncResult" />.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />, and retrieves one or more result sets from the server.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll or wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />, which returns a <see cref="T:System.Data.SqlClient.SqlDataReader" /> instance that can be used to retrieve the returned rows.</para>
</returns>
</Docs>
</Member>
<Member MemberName="BeginExecuteReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteReader (System.Data.CommandBehavior behavior);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="behavior" Type="System.Data.CommandBehavior" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method to finish the operation and retrieve the <see cref="T:System.Data.SqlClient.SqlDataReader" /> returned by the command. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method returns immediately, but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <paramref name="behavior" /> parameter lets you specify options that control the behavior of the command and its connection. These values can be combined together (using the programming language's OR operator); generally, developers use the CommandBehavior.CloseConnection value to make sure that the connection is closed by the runtime when the <see cref="T:System.Data.SqlClient.SqlDataReader" /> is closed. </para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> may block if more data is required and the underlying network's read operation blocks.</para>
<para>Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <see cref="P:System.IAsyncResult.IsCompleted" /> property of the <see cref="T:System.IAsyncResult" /> returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method; or wait for the completion of one or more commands using the <see cref="P:System.IAsyncResult.AsyncWaitHandle" /> property of the returned <see cref="T:System.IAsyncResult" />.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" /> using one of the <see cref="T:System.Data.CommandBehavior" /> values.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll, wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />, which returns a <see cref="T:System.Data.SqlClient.SqlDataReader" /> instance that can be used to retrieve the returned rows.</para>
</returns>
<param name="behavior">
<attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.CommandBehavior" /> values, indicating options for statement execution and data retrieval.</param>
</Docs>
</Member>
<Member MemberName="BeginExecuteReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method to finish the operation and retrieve the <see cref="T:System.Data.SqlClient.SqlDataReader" /> returned by the command. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method returns immediately, but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> before the command's execution is completed cause the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <paramref name="callback" /> parameter lets you specify an <see cref="T:System.AsyncCallback" /> delegate that is called when the statement has completed. You can call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the <paramref name="stateObject" /> parameter, and your callback procedure can retrieve this information using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> may block if more data is required and the underlying network's read operation blocks.</para>
<para>Because the callback procedure executes from within a background thread supplied by the Microsoft .NET runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure; should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.</para>
<para>All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" /> and retrieves one or more result sets from the server, given a callback procedure and state information.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll, wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />, which returns a <see cref="T:System.Data.SqlClient.SqlDataReader" /> instance which can be used to retrieve the returned rows.</para>
</returns>
<param name="callback">
<attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.AsyncCallback" /> delegate that is invoked when the command's execution has completed. Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.</param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</param>
</Docs>
</Member>
<Member MemberName="BeginExecuteReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, System.Data.CommandBehavior behavior);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
<Parameter Name="behavior" Type="System.Data.CommandBehavior" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method to finish the operation and retrieve the <see cref="T:System.Data.SqlClient.SqlDataReader" /> returned by the command. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method returns immediately, but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <paramref name="callback" /> parameter lets you specify an <see cref="T:System.AsyncCallback" /> delegate that is called when the statement has completed. You can call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the <paramref name="stateObject" /> parameter, and your callback procedure can retrieve this information using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</para>
<para>The <paramref name="behavior" /> parameter lets you specify options that control the behavior of the command and its connection. These values can be combined together (using the programming language's Or operator); generally, developers use the CloseConnection value to make sure that the connection is closed by the runtime when the <see cref="T:System.Data.SqlClient.SqlDataReader" /> is closed. Developers can also optimize the behavior of the <see cref="T:System.Data.SqlClient.SqlDataReader" /> by specifying the SingleRow value when it is known in advance that the Transact-SQL statement or stored procedure only returns a single row.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> may block if more data is required and the underlying network's read operation blocks.</para>
<para>Because the callback procedure executes from within a background thread supplied by the Microsoft .NET common language runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure--should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.</para>
<para>All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" />, using one of the CommandBehavior values, and retrieving one or more result sets from the server, given a callback procedure and state information. </para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll or wait for results, or both; this value is also needed when invoking <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />, which returns a <see cref="T:System.Data.SqlClient.SqlDataReader" /> instance which can be used to retrieve the returned rows.</para>
</returns>
<param name="callback">
<attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.AsyncCallback" /> delegate that is invoked when the command's execution has completed. Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.</param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</param>
<param name="behavior">
<attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.CommandBehavior" /> values, indicating options for statement execution and data retrieval.</param>
</Docs>
</Member>
<Member MemberName="BeginExecuteXmlReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteXmlReader ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method starts the process of asynchronously executing a Transact-SQL statement that returns rows as XML, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the EndExecuteXmlReader method to finish the operation and retrieve the XML returned by the command. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method returns immediately, but until the code executes the corresponding EndExecuteXmlReader method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the EndExecuteXmlReader before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property ordinarily specifies a Transact-SQL statement with a valid FOR XML clause. However, CommandText can also specify a statement that returns ntext data that contains valid XML.</para>
<para>A typical <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader(System.AsyncCallback,System.Object)" /> query can be formatted as in the following C# example:</para>
<code>SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM dbo.Contact FOR XML AUTO, XMLDATA", SqlConn);</code>
<para>This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the EndExecuteXmlReader method attaches the <see cref="T:System.Xml.XmlReader" /> to the value on the first row, and discards the rest of the result set.</para>
<para>The multiple active result set (MARS) feature lets multiple actions use the same connection.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous.</para>
<para>Because this overload does not support a callback procedure, developers need to either poll to determine whether the command has completed, using the <see cref="P:System.IAsyncResult.IsCompleted" /> property of the <see cref="T:System.IAsyncResult" /> returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method; or wait for the completion of one or more commands using the <see cref="P:System.IAsyncResult.AsyncWaitHandle" /> property of the returned <see cref="T:System.IAsyncResult" />.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" /> and returns results as an <see cref="T:System.Xml.XmlReader" /> object.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll or wait for results, or both; this value is also needed when invoking EndExecuteXmlReader, which returns a single XML value.</para>
</returns>
</Docs>
</Member>
<Member MemberName="BeginExecuteXmlReader">
<MemberSignature Language="C#" Value="public IAsyncResult BeginExecuteXmlReader (AsyncCallback callback, object stateObject);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows as XML, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> method to finish the operation and retrieve the requested XML data. The <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method returns immediately, but until the code executes the corresponding <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <see cref="T:System.Data.SqlClient.SqlCommand" /> object. Calling the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> before the command's execution is completed causes the <see cref="T:System.Data.SqlClient.SqlCommand" /> object to block until the execution is finished.</para>
<para>The <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property ordinarily specifies a Transact-SQL statement with a valid FOR XML clause. However, CommandText can also specify a statement that returns data that contains valid XML. This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> method attaches the <see cref="T:System.Xml.XmlReader" /> to the value on the first row, and discards the rest of the result set.</para>
<para>A typical <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader(System.AsyncCallback,System.Object)" /> query can be formatted as in the following C# example:</para>
<code>SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM Contact FOR XML AUTO, XMLDATA", SqlConn);</code>
<para>This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> method attaches the <see cref="T:System.Xml.XmlReader" /> to the value on the first row, and discards the rest of the result set.</para>
<para>The multiple active result set (MARS) feature lets multiple actions use the same connection.</para>
<para>The <paramref name="callback" /> parameter lets you specify an <see cref="T:System.AsyncCallback" /> delegate that is called when the statement has completed. You can call the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the <paramref name="stateObject" /> parameter, and your callback procedure can retrieve this information using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</para>
<para>Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters is sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. </para>
<para>All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <see cref="T:System.Data.SqlClient.SqlCommand" /> and returns results as an <see cref="T:System.Xml.XmlReader" /> object, using a callback procedure.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.IAsyncResult" /> that can be used to poll, wait for results, or both; this value is also needed when the <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> is called, which returns the results of the command as XML.</para>
</returns>
<param name="callback">
<attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.AsyncCallback" /> delegate that is invoked when the command's execution has completed. Pass null (Nothing in Microsoft Visual Basic) to indicate that no callback is required.</param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the <see cref="P:System.IAsyncResult.AsyncState" /> property.</param>
</Docs>
</Member>
<Member MemberName="Cancel">
<MemberSignature Language="C#" Value="public override void Cancel ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If there is nothing to cancel, nothing occurs. However, if there is a command in process, and the attempt to cancel fails, no exception is generated. </para>
<para>In some, rare, cases, if you call <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> then call <see cref="M:System.Data.SqlClient.SqlDataReader.Close" /> (implicitily or explicitly) before calling <see cref="M:System.Data.SqlClient.SqlCommand.Cancel" />, and then call <see cref="M:System.Data.SqlClient.SqlCommand.Cancel" />, the cancel command will not be sent to SQL Server and the result set can continue to stream after you call <see cref="M:System.Data.SqlClient.SqlConnection.Close" />. To avoid this, make sure that you call <see cref="M:System.Data.SqlClient.SqlCommand.Cancel" /> before closing the reader or connection.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Tries to cancel the execution of a <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlCommand Clone ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlCommand</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a new <see cref="T:System.Data.SqlClient.SqlCommand" /> object that is a copy of the current instance.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A new <see cref="T:System.Data.SqlClient.SqlCommand" /> object that is a copy of this instance.</para>
</returns>
</Docs>
</Member>
<Member MemberName="CommandText">
<MemberSignature Language="C#" Value="public override string CommandText { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'string'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When the <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> property is set to StoredProcedure, the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property should be set to the name of the stored procedure. The user may be required to use escape character syntax if the stored procedure name contains any special characters. The command executes this stored procedure when you call one of the Execute methods.</para>
<para>The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a Transact-SQL statement or a stored procedure called by a command of CommandType.Text. In this case, named parameters must be used. For example: </para>
<code> SELECT * FROM dbo.Customers WHERE CustomerID = @CustomerID</code>
<para>For more information, see <format type="text/html"><a href="537d8a2c-d40b-4000-83eb-bc1fcc93f707">Using Stored Procedures with a Command</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlCommandTextEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="CommandTimeout">
<MemberSignature Language="C#" Value="public override int CommandTimeout { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>Current value in seconds.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).</para>
<block subset="none" type="note">
<para>The <see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> property will be ignored during asynchronous method calls such as <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" />.</para>
</block>
<para>
<see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> has no effect when the command is executed against a context connection (a <see cref="T:System.Data.SqlClient.SqlConnection" /> opened with "context connection=true" in the connection string).</para>
<block subset="none" type="note">
<para>This property is the cumulative time-out (for all network packets that are read during the invocation of a method) for all network reads during command execution or processing of the results. A time-out can still occur after the first row is returned, and does not include user processing time, only network read time.</para>
<para>For example, with a 30 second time out, if <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> requires two network packets, then it has 30 seconds to read both network packets. If you call <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> again, it will have another 30 seconds to read any data that it requires.</para>
</block>
<code>using System;
using System.Data.SqlClient;
///
public class A {
///
public static void Main() {
string connectionString = "";
// Wait for 5 second delay in the command
string queryString = "waitfor delay '00:00:05'";
using (SqlConnection connection = new SqlConnection(connectionString)) {
connection.Open();
SqlCommand command = new SqlCommand(queryString, connection);
// Setting command timeout to 1 second
command.CommandTimeout = 1;
try {
command.ExecuteNonQuery();
}
catch (SqlException e) {
Console.WriteLine("Got expected SqlException due to command timeout ");
Console.WriteLine(e);
}
}
}
}</code>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the wait time before terminating the attempt to execute a command and generating an error.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CommandType">
<MemberSignature Language="C#" Value="public override System.Data.CommandType CommandType { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Data.CommandType</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'Data.CommandType'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When you set the <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> property to StoredProcedure, you should set the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property to the name of the stored procedure. The command executes this stored procedure when you call one of the Execute methods.</para>
<para>The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a SQL Statement or a stored procedure called with a <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> of <see cref="F:System.Data.CommandType.Text" />. In this case, named parameters must be used. For example: </para>
<para>SELECT * FROM Customers WHERE CustomerID = @CustomerID </para>
<para>For more information, see <format type="text/html"><a href="537d8a2c-d40b-4000-83eb-bc1fcc93f707">Using Stored Procedures with a Command</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value indicating how the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property is to be interpreted.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(System.Data.CommandType.Text)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="Connection">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlConnection Connection { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlConnection</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'SqlConnection'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If the command is enlisted in an existing transaction, and the connection is changed, trying to execute the command will throw an <see cref="T:System.InvalidOperationException" />.</para>
<para>If the <see cref="P:System.Data.SqlClient.SqlCommand.Transaction" /> property is not null and the transaction has already been committed or rolled back, <see cref="P:System.Data.SqlClient.SqlCommand.Transaction" /> is set to null.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Data.SqlClient.SqlConnection" /> used by this instance of the <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="CreateDbParameter">
<MemberSignature Language="C#" Value="protected override System.Data.Common.DbParameter CreateDbParameter ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.Common.DbParameter</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateParameter">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlParameter CreateParameter ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlParameter</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.Data.SqlClient.SqlCommand.CreateParameter" /> method is a strongly-typed version of <see cref="M:System.Data.IDbCommand.CreateParameter" />.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a new instance of a <see cref="T:System.Data.SqlClient.SqlParameter" /> object.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlParameter" /> object.</para>
</returns>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="DbConnection">
<MemberSignature Language="C#" Value="protected override System.Data.Common.DbConnection DbConnection { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.Common.DbConnection</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DbParameterCollection">
<MemberSignature Language="C#" Value="protected override System.Data.Common.DbParameterCollection DbParameterCollection { get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.Common.DbParameterCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DbTransaction">
<MemberSignature Language="C#" Value="protected override System.Data.Common.DbTransaction DbTransaction { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.Common.DbTransaction</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DesignTimeVisible">
<MemberSignature Language="C#" Value="public override bool DesignTimeVisible { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'bool'</value>
<remarks>To be added</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignOnly(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="EndExecuteNonQuery">
<MemberSignature Language="C#" Value="public int EndExecuteNonQuery (IAsyncResult asyncResult);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When you call <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> to execute a tsql statement, you must call <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" /> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <see cref="T:System.IAsyncResult" /> instance returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /> method. If a callback procedure was specified in the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />, this method must be called.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Finishes asynchronous execution of a Transact-SQL statement.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The number of rows affected (the same behavior as <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteNonQuery" />).</para>
</returns>
<param name="asyncResult">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.IAsyncResult" /> returned by the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />.</param>
</Docs>
</Member>
<Member MemberName="EndExecuteReader">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlDataReader EndExecuteReader (IAsyncResult asyncResult);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlDataReader</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When you call <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to execute a Transact-SQL statement, you must call <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" /> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <see cref="T:System.IAsyncResult" /> instance returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> method. If a callback procedure was specified in the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" />, this method must be called.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Finishes asynchronous execution of a Transact-SQL statement, returning the requested <see cref="T:System.Data.SqlClient.SqlDataReader" />.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlDataReader" /> object that can be used to retrieve the requested rows.</para>
</returns>
<param name="asyncResult">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.IAsyncResult" /> returned by the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" />.</param>
</Docs>
</Member>
<Member MemberName="EndExecuteXmlReader">
<MemberSignature Language="C#" Value="public System.Xml.XmlReader EndExecuteXmlReader (IAsyncResult asyncResult);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlReader</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When you call <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to execute a Transact-SQL statement, you must call <see cref="M:System.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <see cref="T:System.IAsyncResult" /> instance returned by the <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> method. If a callback procedure was specified in the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />, this method must be called.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.Xml.XmlReader" /> object that can be used to fetch the resulting XML data.</para>
</returns>
<param name="asyncResult">
<attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.IAsyncResult" /> returned by the call to <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />.</param>
</Docs>
</Member>
<Member MemberName="ExecuteDbDataReader">
<MemberSignature Language="C#" Value="protected override System.Data.Common.DbDataReader ExecuteDbDataReader (System.Data.CommandBehavior behavior);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.Common.DbDataReader</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="behavior" Type="System.Data.CommandBehavior" />
</Parameters>
<Docs>
<param name="behavior">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ExecuteNonQuery">
<MemberSignature Language="C#" Value="public override int ExecuteNonQuery ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>You can use the <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteNonQuery" /> to perform catalog operations (for example, querying the structure of a database or creating database objects such as tables), or to change the data in a database without using a <see cref="T:System.Data.DataSet" /> by executing UPDATE, INSERT, or DELETE statements.</para>
<para>Although the <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteNonQuery" /> returns no rows, any output parameters or return values mapped to parameters are populated with data.</para>
<para>For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Executes a Transact-SQL statement against the connection and returns the number of rows affected.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The number of rows affected.</para>
</returns>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ExecuteReader">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlDataReader ExecuteReader ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlDataReader</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When the <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> property is set to StoredProcedure, the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property should be set to the name of the stored procedure. The command executes this stored procedure when you call <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" />.</para>
<block subset="none" type="note">
<para>If a transaction is deadlocked, an exception may not be thrown until <see cref="M:System.Data.SqlClient.SqlDataReader.Read" /> is called.</para>
</block>
<para>The multiple active result set (MARS) feature allows for multiple actions using the same connection.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> and builds a <see cref="T:System.Data.SqlClient.SqlDataReader" />.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlDataReader" /> object.</para>
</returns>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ExecuteReader">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlDataReader ExecuteReader (System.Data.CommandBehavior behavior);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlDataReader</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="behavior" Type="System.Data.CommandBehavior" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When the <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> property is set to StoredProcedure, the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property should be set to the name of the stored procedure. The command executes this stored procedure when you call <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" />.</para>
<block subset="none" type="note">
<para>Use <see cref="F:System.Data.CommandBehavior.SequentialAccess" /> to retrieve large values and binary data. Otherwise, an <see cref="T:System.OutOfMemoryException" /> might occur and the connection will be closed.</para>
</block>
<para>The multiple active result set (MARS) feature allows for multiple actions using the same connection.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" />, and builds a <see cref="T:System.Data.SqlClient.SqlDataReader" /> using one of the <see cref="T:System.Data.CommandBehavior" /> values.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlDataReader" /> object.</para>
</returns>
<param name="behavior">
<attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.CommandBehavior" /> values.</param>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ExecuteScalar">
<MemberSignature Language="C#" Value="public override object ExecuteScalar ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteScalar" /> method to retrieve a single value (for example, an aggregate value) from a database. This requires less code than using the <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> method, and then performing the operations that you need to generate the single value using the data returned by a <see cref="T:System.Data.SqlClient.SqlDataReader" />.</para>
<para>A typical <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteScalar" /> query can be formatted as in the following C# example: </para>
<code> cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
Int32 count = (Int32) cmd.ExecuteScalar();</code>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is empty. Returns a maximum of 2033 characters.</para>
</returns>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ExecuteXmlReader">
<MemberSignature Language="C#" Value="public System.Xml.XmlReader ExecuteXmlReader ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Xml.XmlReader</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> property ordinarily specifies a tsql statement with a valid FOR XML clause. However, <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> can also specify a statement that returns ntext or nvarchar data that contains valid XML, or the contents of a column defined with the xml data type. </para>
<para>A typical <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> query can be formatted as in the following Microsoft Visual C# example: </para>
<code>SqlCommand command = new SqlCommand("SELECT * FROM dbo.Customers FOR XML AUTO, XMLDATA", SqlConn);</code>
<para>This method can also be used to retrieve a single-row, single-column result set that contains XML data. In this case, if more than one row is returned, the <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> method attaches the <see cref="T:System.Xml.XmlReader" /> to the value on the first row, and discards the rest of the result set.</para>
<para>The multiple active result set (MARS) feature allows for multiple actions using the same connection.</para>
<para>If you use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteReader" /> or <see cref="M:System.Data.SqlClient.SqlCommand.BeginExecuteReader" /> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <see cref="M:System.Data.SqlClient.SqlCommand.ExecuteXmlReader" /> or <see cref="Overload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" /> to read FOR XML queries. For more information, see article Q310378, "PRB: XML Data Is Truncated When You Use SqlDataReader," in the Microsoft Knowledge Base at http://support.microsoft.com.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" /> and builds an <see cref="T:System.Xml.XmlReader" /> object.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An <see cref="T:System.Xml.XmlReader" /> object.</para>
</returns>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Notification">
<MemberSignature Language="C#" Value="public System.Data.Sql.SqlNotificationRequest Notification { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Data.Sql.SqlNotificationRequest</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>You must set the value for this property before the command is executed for it to take effect.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value that specifies the <see cref="T:System.Data.Sql.SqlNotificationRequest" /> object bound to this command.</para>
</summary>
</Docs>
</Member>
<Member MemberName="NotificationAutoEnlist">
<MemberSignature Language="C#" Value="public bool NotificationAutoEnlist { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This feature is used in ASP.NET applications to receive notifications for all commands executed in an ASP page against SQL Server. This enables ASP.NET to cache the page until the queries used to render the page would produce a different result. Automatic enlistment.</para>
<para>This property applies only to versions of SQL Server that support query notifications. For earlier versions, setting this property to true has no effect on the application.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets a value indicating whether the application should automatically receive query notifications from a common <see cref="T:System.Data.SqlClient.SqlDependency" /> object.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Parameters">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlParameterCollection Parameters { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlParameterCollection</ReturnType>
</ReturnValue>
<Docs>
<value>To be added: an object of type 'SqlParameterCollection'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a SQL Statement or a stored procedure called by a command of CommandType.Text. In this case, named parameters must be used. For example: </para>
<para>SELECT * FROM Customers WHERE CustomerID = @CustomerID </para>
<block subset="none" type="note">
<para>If the parameters in the collection do not match the requirements of the query to be executed, an error may result.</para>
</block>
<para>For more information, see <format type="text/html"><a href="537d8a2c-d40b-4000-83eb-bc1fcc93f707">Using Stored Procedures with a Command</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the <see cref="T:System.Data.SqlClient.SqlParameterCollection" />.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="Prepare">
<MemberSignature Language="C#" Value="public override void Prepare ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If <see cref="P:System.Data.SqlClient.SqlCommand.CommandType" /> is set to StoredProcedure, the call to <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" /> should succeed, although it may cause a no-op.</para>
<para>Before you call <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" />, specify the data type of each parameter in the statement to be prepared. For each parameter that has a variable length data type, you must set the <see cref="P:System.Data.SqlClient.SqlParameter.Size" /> property to the maximum size needed. <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" /> returns an error if these conditions are not met.</para>
<block subset="none" type="note">
<para>If the database context is changed by executing the Transact-SQL USE <database> statement, or by calling the <see cref="M:System.Data.SqlClient.SqlConnection.ChangeDatabase(System.String)" /> method, then <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" /> must be called a second time.</para>
</block>
<para>If you call an Execute method after calling <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" />, any parameter value that is larger than the value specified by the <see cref="P:System.Data.SqlClient.SqlParameter.Size" /> property is automatically truncated to the original specified size of the parameter, and no truncation errors are returned.</para>
<para>Output parameters (whether prepared or not) must have a user-specified data type. If you specify a variable length data type, you must also specify the maximum <see cref="P:System.Data.SqlClient.SqlParameter.Size" />.</para>
<para>Prior to Visual Studio 2010, <see cref="M:System.Data.SqlClient.SqlCommand.Prepare" /> threw an exception. Beginning in Visual Studio 2010, this method does not throw an exception.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a prepared version of the command on an instance of SQL Server.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="ResetCommandTimeout">
<MemberSignature Language="C#" Value="public void ResetCommandTimeout ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The default value of the <see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> is 30 seconds.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Resets the <see cref="P:System.Data.SqlClient.SqlCommand.CommandTimeout" /> property to its default value.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="StatementCompleted">
<MemberSignature Language="C#" Value="public event System.Data.StatementCompletedEventHandler StatementCompleted;" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.StatementCompletedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Occurs when the execution of a Transact-SQL statement completes.</para>
</summary>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.Connection">
<MemberSignature Language="C#" Value="System.Data.IDbConnection System.Data.IDbCommand.Connection { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDbConnection</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Data.SqlClient.SqlConnection" /> used by this instance of the <see cref="T:System.Data.SqlClient.SqlCommand" />.</para>
</summary>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.CreateParameter">
<MemberSignature Language="C#" Value="System.Data.IDbDataParameter IDbCommand.CreateParameter ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDbDataParameter</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a new instance of a <see cref="T:System.Data.SqlClient.SqlParameter" /> object.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlParameter" /> object.</para>
</returns>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.ExecuteReader">
<MemberSignature Language="C#" Value="System.Data.IDataReader IDbCommand.ExecuteReader ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDataReader</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" />, and builds a <see cref="T:System.Data.SqlClient.SqlDataReader" />.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlDataReader" /> object.</para>
</returns>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.ExecuteReader">
<MemberSignature Language="C#" Value="System.Data.IDataReader IDbCommand.ExecuteReader (System.Data.CommandBehavior behavior);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDataReader</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="behavior" Type="System.Data.CommandBehavior" />
</Parameters>
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sends the <see cref="P:System.Data.SqlClient.SqlCommand.CommandText" /> to the <see cref="P:System.Data.SqlClient.SqlCommand.Connection" />, and builds a <see cref="T:System.Data.SqlClient.SqlDataReader" /> using one of the <see cref="T:System.Data.CommandBehavior" /> values.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A <see cref="T:System.Data.SqlClient.SqlDataReader" /> object.</para>
</returns>
<param name="behavior">
<attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.CommandBehavior" /> values. </param>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.Parameters">
<MemberSignature Language="C#" Value="System.Data.IDataParameterCollection System.Data.IDbCommand.Parameters { get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDataParameterCollection</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the parameter collection.</para>
</summary>
</Docs>
</Member>
<Member MemberName="System.Data.IDbCommand.Transaction">
<MemberSignature Language="C#" Value="System.Data.IDbTransaction System.Data.IDbCommand.Transaction { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Data.IDbTransaction</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="System.ICloneable.Clone">
<MemberSignature Language="C#" Value="object ICloneable.Clone ();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>To be added.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Creates a new <see cref="T:System.Data.SqlClient.SqlCommand" /> object that is a copy of the current instance.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A new <see cref="T:System.Data.SqlClient.SqlCommand" /> object that is a copy of this instance.</para>
</returns>
</Docs>
</Member>
<Member MemberName="Transaction">
<MemberSignature Language="C#" Value="public System.Data.SqlClient.SqlTransaction Transaction { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Data.SqlClient.SqlTransaction</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'SqlTransaction'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>You cannot set the <see cref="P:System.Data.SqlClient.SqlCommand.Transaction" /> property if it is already set to a specific value, and the command is in the process of executing. If you set the transaction property to a <see cref="T:System.Data.SqlClient.SqlTransaction" /> object that is not connected to the same <see cref="T:System.Data.SqlClient.SqlConnection" /> as the <see cref="T:System.Data.SqlClient.SqlCommand" /> object, an exception is thrown the next time that you attempt to execute a statement.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the <see cref="T:System.Data.SqlClient.SqlTransaction" /> within which the <see cref="T:System.Data.SqlClient.SqlCommand" /> executes.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="UpdatedRowSource">
<MemberSignature Language="C#" Value="public override System.Data.UpdateRowSource UpdatedRowSource { set; get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Data.UpdateRowSource</ReturnType>
</ReturnValue>
<Parameters>
</Parameters>
<Docs>
<value>To be added: an object of type 'Data.UpdateRowSource'</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The default <see cref="T:System.Data.UpdateRowSource" /> value is Both unless the command is automatically generated (as in the case of the <see cref="T:System.Data.SqlClient.SqlCommandBuilder" />), in which case the default is None.</para>
<para>For more information about using the UpdatedRowSource property, see <format type="text/html"><a href="f21e6aba-b76d-46ad-a83e-2ad8e0af1e12">Using Parameters with a DataAdapter</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets how command results are applied to the <see cref="T:System.Data.DataRow" /> when used by the Update method of the <see cref="T:System.Data.Common.DbDataAdapter" />.</para>
</summary>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(System.Data.UpdateRowSource.Both)</AttributeName>
</Attribute>
</Attributes>
</Member>
</Members>
</Type>
|