System.Data
[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]
1.0.3300.0
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Data.Common.DbCommand
System.ICloneable
System.ComponentModel.DefaultEvent("RecordsAffected")
System.ComponentModel.ToolboxItem("System.Drawing.Design.ToolboxItem, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
System.ComponentModel.Designer("Microsoft.VSDesigner.Data.VS.SqlCommandDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")
When an instance of is created, the read/write properties are set to their initial values. For a list of these values, see the constructor.
features the following methods for executing commands at a SQL Server database:
-
Item
Description
-
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this , generally executing commands such as INSERT, DELETE, UPDATE, and SET statements. Each call to must be paired with a call to which finishes the operation, typically on a separate thread.
-
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this and retrieves one or more results sets from the server. Each call to must be paired with a call to which finishes the operation, typically on a separate thread.
-
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this . Each call to BeginExecuteXmlReader must be paired with a call to EndExecuteXmlReader, which finishes the operation, typically on a separate thread, and returns an object.
-
Executes commands that return rows. For increased performance, invokes commands using the Transact-SQL sp_executesql system stored procedure. Therefore, might not have the effect that you want if used to execute commands such as Transact-SQL SET statements.
-
Executes commands such as Transact-SQL INSERT, DELETE, UPDATE, and SET statements.
-
Retrieves a single value (for example, an aggregate value) from a database.
-
Sends the to the and builds an object.
You can reset the property and reuse the object. However, you must close the before you can execute a new or previous command.
If a is generated by the method executing a , the remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the . However, the user can reopen the connection and continue.
Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
Constructor
The base constructor initializes all fields to their default values. The following table shows initial property values for an instance of .
-
Properties
Initial value
-
empty string ("")
-
30
-
CommandType.Text
-
Null
You can change the value for any of these properties through a separate call to the property.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Constructor
When an instance of is created, the following read/write properties are set to initial values.
-
Properties
Initial value
-
-
30
-
CommandType.Text
-
null
You can change the value for any of these properties through a separate call to the property.
Initializes a new instance of the class with the text of the query.
The text of the query.
1.0.5000.0
2.0.0.0
Constructor
The following table shows initial property values for an instance of .
-
Properties
Initial value
-
-
30
-
CommandType.Text
-
A new that is the value for the parameter.
You can change the value for any of these parameters by setting the related property.
Initializes a new instance of the class with the text of the query and a .
The text of the query.
A that represents the connection to an instance of SQL Server.
1.0.5000.0
2.0.0.0
Constructor
The following table shows initial property values for an instance of .
-
Properties
Initial value
-
-
30
-
CommandType.Text
-
A new that is the value for the parameter.
You can change the value for any of these parameters by setting the related property.
Initializes a new instance of the class with the text of the query, a , and the .
The text of the query.
A that represents the connection to an instance of SQL Server.
The in which the executes.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation. The method returns immediately ( has no effect on ), but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
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.
Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the property of the returned by the method; or wait for the completion of one or more commands using the property of the returned .
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this .
An that can be used to poll or wait for results, or both; this value is also needed when invoking , which returns the number of affected rows.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation. The method returns immediately ( has no effect on ), but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
The parameter lets you specify an delegate that is called when the statement has completed. You can call the method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the parameter, and your callback procedure can retrieve this information using the property.
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.
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.
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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this , given a callback procedure and state information.
An that can be used to poll or wait for results, or both; this value is also needed when invoking , which returns the number of affected rows.
An 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.
A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the property.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation and retrieve the returned by the command. The method returns immediately, but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
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 may block if more data is required and the underlying network's read operation blocks.
Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the property of the returned by the method; or wait for the completion of one or more commands using the property of the returned .
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this , and retrieves one or more result sets from the server.
An that can be used to poll or wait for results, or both; this value is also needed when invoking , which returns a instance that can be used to retrieve the returned rows.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation and retrieve the returned by the command. The method returns immediately, but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
The 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 is closed.
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 may block if more data is required and the underlying network's read operation blocks.
Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the property of the returned by the method; or wait for the completion of one or more commands using the property of the returned .
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this using one of the values.
An that can be used to poll, wait for results, or both; this value is also needed when invoking , which returns a instance that can be used to retrieve the returned rows.
One of the values, indicating options for statement execution and data retrieval.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation and retrieve the returned by the command. The method returns immediately, but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed cause the object to block until the execution is finished.
The parameter lets you specify an delegate that is called when the statement has completed. You can call the method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the parameter, and your callback procedure can retrieve this information using the property.
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 may block if more data is required and the underlying network's read operation blocks.
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.
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.
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this and retrieves one or more result sets from the server, given a callback procedure and state information.
An that can be used to poll, wait for results, or both; this value is also needed when invoking , which returns a instance which can be used to retrieve the returned rows.
An 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.
A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the property.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation and retrieve the returned by the command. The method returns immediately, but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
The parameter lets you specify an delegate that is called when the statement has completed. You can call the method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the parameter, and your callback procedure can retrieve this information using the property.
The 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 is closed. Developers can also optimize the behavior of the by specifying the SingleRow value when it is known in advance that the Transact-SQL statement or stored procedure only returns a single row.
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 may block if more data is required and the underlying network's read operation blocks.
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.
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.
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this , using one of the CommandBehavior values, and retrieving one or more result sets from the server, given a callback procedure and state information.
An that can be used to poll or wait for results, or both; this value is also needed when invoking , which returns a instance which can be used to retrieve the returned rows.
An 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.
A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the property.
One of the values, indicating options for statement execution and data retrieval.
Method
2.0.0.0
System.IAsyncResult
The 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 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 object. Calling the EndExecuteXmlReader before the command's execution is completed causes the object to block until the execution is finished.
The 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.
A typical query can be formatted as in the following C# example:
SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM dbo.Contact FOR XML AUTO, XMLDATA", SqlConn);
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 to the value on the first row, and discards the rest of the result set.
The multiple active result set (MARS) feature lets multiple actions use the same connection.
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.
Because this overload does not support a callback procedure, developers need to either poll to determine whether the command has completed, using the property of the returned by the method; or wait for the completion of one or more commands using the property of the returned .
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this and returns results as an object.
An 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.
Method
2.0.0.0
System.IAsyncResult
The 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 method to finish the operation and retrieve the requested XML data. The method returns immediately, but until the code executes the corresponding method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same object. Calling the before the command's execution is completed causes the object to block until the execution is finished.
The 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 method attaches the to the value on the first row, and discards the rest of the result set.
A typical query can be formatted as in the following C# example:
SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM Contact FOR XML AUTO, XMLDATA", SqlConn);
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 method attaches the to the value on the first row, and discards the rest of the result set.
The multiple active result set (MARS) feature lets multiple actions use the same connection.
The parameter lets you specify an delegate that is called when the statement has completed. You can call the method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the parameter, and your callback procedure can retrieve this information using the property.
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.
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.
If you use or 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 or 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.
Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this and returns results as an object, using a callback procedure.
An that can be used to poll, wait for results, or both; this value is also needed when the is called, which returns the results of the command as XML.
An 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.
A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the property.
Method
System.Void
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.
In some, rare, cases, if you call then call (implicitily or explicitly) before calling , and then call , the cancel command will not be sent to SQL Server and the result set can continue to stream after you call . To avoid this, make sure that you call before closing the reader or connection.
Tries to cancel the execution of a .
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Data.SqlClient.SqlCommand
To be added.
Creates a new object that is a copy of the current instance.
A new object that is a copy of this instance.
Property
System.String
To be added: an object of type 'string'
When the property is set to StoredProcedure, the 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.
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:
SELECT * FROM dbo.Customers WHERE CustomerID = @CustomerID
For more information, see Using Stored Procedures with a Command.
Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.
1.0.5000.0
2.0.0.0
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
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")
System.ComponentModel.DefaultValue("")
Property
System.Int32
Current value in seconds.
A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).
The property will be ignored during asynchronous method calls such as .
has no effect when the command is executed against a context connection (a opened with "context connection=true" in the connection string).
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.
For example, with a 30 second time out, if requires two network packets, then it has 30 seconds to read both network packets. If you call again, it will have another 30 seconds to read any data that it requires.
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);
}
}
}
}
Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
1.0.5000.0
2.0.0.0
Property
System.Data.CommandType
To be added: an object of type 'Data.CommandType'
When you set the property to StoredProcedure, you should set the property to the name of the stored procedure. The command executes this stored procedure when you call one of the Execute methods.
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 of . In this case, named parameters must be used. For example:
SELECT * FROM Customers WHERE CustomerID = @CustomerID
For more information, see Using Stored Procedures with a Command.
Gets or sets a value indicating how the property is to be interpreted.
1.0.5000.0
2.0.0.0
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.ComponentModel.DefaultValue(System.Data.CommandType.Text)
Property
System.Data.SqlClient.SqlConnection
To be added: an object of type 'SqlConnection'
If the command is enlisted in an existing transaction, and the connection is changed, trying to execute the command will throw an .
If the property is not null and the transaction has already been committed or rolled back, is set to null.
Gets or sets the used by this instance of the .
1.0.5000.0
2.0.0.0
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")
System.ComponentModel.DefaultValue(null)
Method
2.0.0.0
System.Data.Common.DbParameter
To be added.
To be added.
To be added.
Method
System.Data.SqlClient.SqlParameter
The method is a strongly-typed version of .
Creates a new instance of a object.
A object.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.Data.Common.DbConnection
To be added.
To be added.
To be added.
Property
2.0.0.0
System.Data.Common.DbParameterCollection
To be added.
To be added.
To be added.
Property
2.0.0.0
System.Data.Common.DbTransaction
To be added.
To be added.
To be added.
Property
System.Boolean
To be added: an object of type 'bool'
To be added
Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.
1.0.5000.0
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.DesignOnly(true)
System.ComponentModel.DefaultValue(true)
System.ComponentModel.Browsable(false)
Method
2.0.0.0
System.Void
To be added.
To be added.
To be added.
Method
2.0.0.0
System.Int32
When you call to execute a tsql statement, you must call 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 instance returned by the method. If a callback procedure was specified in the call to , this method must be called.
Finishes asynchronous execution of a Transact-SQL statement.
The number of rows affected (the same behavior as ).
The returned by the call to .
Method
2.0.0.0
System.Data.SqlClient.SqlDataReader
When you call to execute a Transact-SQL statement, you must call 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 instance returned by the method. If a callback procedure was specified in the call to , this method must be called.
Finishes asynchronous execution of a Transact-SQL statement, returning the requested .
A object that can be used to retrieve the requested rows.
The returned by the call to .
Method
2.0.0.0
System.Xml.XmlReader
When you call to execute a Transact-SQL statement, you must call 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 instance returned by the method. If a callback procedure was specified in the call to , this method must be called.
Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.
An object that can be used to fetch the resulting XML data.
The returned by the call to .
Method
2.0.0.0
System.Data.Common.DbDataReader
To be added.
To be added.
To be added.
To be added.
Method
System.Int32
You can use the 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 by executing UPDATE, INSERT, or DELETE statements.
Although the returns no rows, any output parameters or return values mapped to parameters are populated with data.
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.
Executes a Transact-SQL statement against the connection and returns the number of rows affected.
The number of rows affected.
1.0.5000.0
2.0.0.0
Method
System.Data.SqlClient.SqlDataReader
When the property is set to StoredProcedure, the property should be set to the name of the stored procedure. The command executes this stored procedure when you call .
If a transaction is deadlocked, an exception may not be thrown until is called.
The multiple active result set (MARS) feature allows for multiple actions using the same connection.
If you use or 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 or 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.
Sends the to the and builds a .
A object.
1.0.5000.0
2.0.0.0
Method
System.Data.SqlClient.SqlDataReader
When the property is set to StoredProcedure, the property should be set to the name of the stored procedure. The command executes this stored procedure when you call .
Use to retrieve large values and binary data. Otherwise, an might occur and the connection will be closed.
The multiple active result set (MARS) feature allows for multiple actions using the same connection.
If you use or 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 or 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.
Sends the to the , and builds a using one of the values.
A object.
One of the values.
1.0.5000.0
2.0.0.0
Method
System.Object
Use the method to retrieve a single value (for example, an aggregate value) from a database. This requires less code than using the method, and then performing the operations that you need to generate the single value using the data returned by a .
A typical query can be formatted as in the following C# example:
cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
Int32 count = (Int32) cmd.ExecuteScalar();
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.
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.
1.0.5000.0
2.0.0.0
Method
System.Xml.XmlReader
The property ordinarily specifies a tsql statement with a valid FOR XML clause. However, 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.
A typical query can be formatted as in the following Microsoft Visual C# example:
SqlCommand command = new SqlCommand("SELECT * FROM dbo.Customers FOR XML AUTO, XMLDATA", SqlConn);
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 method attaches the to the value on the first row, and discards the rest of the result set.
The multiple active result set (MARS) feature allows for multiple actions using the same connection.
If you use or 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 or 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.
Sends the to the and builds an object.
An object.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Data.Sql.SqlNotificationRequest
To be added.
You must set the value for this property before the command is executed for it to take effect.
Gets or sets a value that specifies the object bound to this command.
Property
2.0.0.0
System.ComponentModel.DefaultValue(true)
System.Boolean
To be added.
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.
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.
Gets or sets a value indicating whether the application should automatically receive query notifications from a common object.
Property
System.Data.SqlClient.SqlParameterCollection
To be added: an object of type 'SqlParameterCollection'
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:
SELECT * FROM Customers WHERE CustomerID = @CustomerID
If the parameters in the collection do not match the requirements of the query to be executed, an error may result.
For more information, see Using Stored Procedures with a Command.
Gets the .
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)
Method
System.Void
If is set to StoredProcedure, the call to should succeed, although it may cause a no-op.
Before you call , 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 property to the maximum size needed. returns an error if these conditions are not met.
If the database context is changed by executing the Transact-SQL USE <database> statement, or by calling the method, then must be called a second time.
If you call an Execute method after calling , any parameter value that is larger than the value specified by the property is automatically truncated to the original specified size of the parameter, and no truncation errors are returned.
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 .
Prior to Visual Studio 2010, threw an exception. Beginning in Visual Studio 2010, this method does not throw an exception.
Creates a prepared version of the command on an instance of SQL Server.
1.0.5000.0
2.0.0.0
Method
System.Void
The default value of the is 30 seconds.
Resets the property to its default value.
1.0.5000.0
2.0.0.0
Event
2.0.0.0
System.Data.StatementCompletedEventHandler
To be added.
Occurs when the execution of a Transact-SQL statement completes.
Property
1.0.5000.0
2.0.0.0
System.Data.IDbConnection
To be added.
To be added.
Gets or sets the used by this instance of the .
Method
1.0.5000.0
System.Data.IDbDataParameter
To be added.
Creates a new instance of a object.
A object.
Method
1.0.5000.0
System.Data.IDataReader
To be added.
Sends the to the , and builds a .
A object.
Method
1.0.5000.0
System.Data.IDataReader
To be added.
Sends the to the , and builds a using one of the values.
A object.
One of the values.
Property
1.0.5000.0
2.0.0.0
System.Data.IDataParameterCollection
To be added.
To be added.
Gets the parameter collection.
Property
1.0.5000.0
2.0.0.0
System.Data.IDbTransaction
To be added.
To be added.
To be added.
Method
1.0.5000.0
2.0.0.0
System.Object
To be added.
Creates a new object that is a copy of the current instance.
A new object that is a copy of this instance.
Property
System.Data.SqlClient.SqlTransaction
To be added: an object of type 'SqlTransaction'
You cannot set the 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 object that is not connected to the same as the object, an exception is thrown the next time that you attempt to execute a statement.
Gets or sets the within which the executes.
1.0.5000.0
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
Property
System.Data.UpdateRowSource
To be added: an object of type 'Data.UpdateRowSource'
The default value is Both unless the command is automatically generated (as in the case of the ), in which case the default is None.
For more information about using the UpdatedRowSource property, see Using Parameters with a DataAdapter.
Gets or sets how command results are applied to the when used by the Update method of the .
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Data.UpdateRowSource.Both)