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.OleDbCommandDesigner, 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 executing commands at a data source:

Item

Description

Executes commands that return rows. may not have the effect that you want if used to execute commands such as SQL SET statements.

Executes commands such as SQL INSERT, DELETE, UPDATE, and SET statements.

Retrieves a single value, for example, an aggregate value from a database.

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 fatal (for example, a SQL Server severity level of 20 or greater) is generated by the method executing an , the , the connection may be closed. However, the user can reopen the connection and continue.

Represents an SQL statement or stored procedure to execute against a data source.

- 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

  Text

  null

  Initializes a new instance of the class.

  1.0.5000.0
  2.0.0.0
- Constructor

  The following table shows initial property values for an instance of .

  Properties

  Initial Value

  30

  Text

  null

  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

  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 an .

  The text of the query.
  An that represents the connection to a data source.
  1.0.5000.0
  2.0.0.0
- Constructor

  The following table shows initial property values for an instance of .

  Properties

  Initial Value

  30

  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, an , and the .

  The text of the query.
  An that represents the connection to a data source.
  The transaction in which the executes.
  1.0.5000.0
  2.0.0.0
- 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.

  Tries to cancel the execution of an .

  1.0.5000.0
  2.0.0.0
- Method
  2.0.0.0
  System.Data.OleDb.OleDbCommand 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.

  When is set to TableDirect, the property should be set to the name of the table or tables to be accessed. The user may be required to use escape character syntax if any of the named tables contain any special characters. All rows and columns of the named table or tables will be returned when you call one of the Execute methods.

  You cannot set the , , and properties if the current connection is performing an execute or fetch operation.

  The OLE DB.NET Provider does not support named parameters for passing parameters to an SQL Statement or a stored procedure called by an when is set to Text. In this case, the question mark (?) placeholder must be used. For example:

  SELECT * FROM Customers WHERE CustomerID = ?

  Therefore, the order in which objects are added to the must directly correspond to the position of the question mark placeholder for the parameter.

  For more information, see Using Stored Procedures with a Command.

  Gets or sets the SQL statement 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.ADO.Design.OleDbCommandTextEditor, 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 To be added: an object of type 'int'

  A value of 0 indicates no limit, and should be avoided in a because an attempt to execute a command will wait indefinitely.

  Gets or sets the wait time before terminating an 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 , and properties cannot be set if the current connection is performing an execute or fetch operation.

  The OLE DB .NET Provider does not support named parameters for passing parameters to an SQL statement or a stored procedure called by an when is set to Text. In this case, the question mark (?) placeholder must be used. For example:

  SELECT * FROM Customers WHERE CustomerID = ?

  Therefore, the order in which objects are added to the must directly correspond to the position of the question mark placeholder for the parameter. For more information, see Using Stored Procedures with a Command.

  Gets or sets a value that indicates how the property is interpreted.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
  System.ComponentModel.DefaultValue("Text")
- Property
  System.Data.OleDb.OleDbConnection To be added: an object of type 'OleDbConnection'

  You cannot set the , and properties if the current connection is performing an execute or fetch operation.

  If you set while a transaction is in progress and the property is not null, an is generated. 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.OleDb.OleDbParameter

  The method is a strongly typed version of .

  Creates a new instance of an object.

  An 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 that indicates whether the command object should be visible in a customized Windows Forms Designer control.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
  System.ComponentModel.DefaultValue(true)
  System.ComponentModel.DesignOnly(true)
  System.ComponentModel.Browsable(false)
- Method
  System.Void `` To be added: an object of type 'bool' To be added To be added 1.0.5000.0 2.0.0.0
- 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, to query the structure of a database or to create 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. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

  Executes an SQL statement against the and returns the number of rows affected.

  The number of rows affected.

  1.0.5000.0
  2.0.0.0
- Method
  System.Data.OleDb.OleDbDataReader

  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 .

  Before you close the , first close the object. You must also close the object if you plan to reuse an object.

  Sends the to the and builds an .

  An object.

  1.0.5000.0
  2.0.0.0
- Method
  System.Data.OleDb.OleDbDataReader ``

  When you specify with the method of the object, the .NET Framework Data Provider for OLE DB performs binding using the OLE DB IRow interface if it is available. Otherwise, it uses the IRowset interface. If your SQL statement is expected to return only a single row, specifying can also improve application performance.

  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 .

  The supports a special mode that enables large binary values to be read efficiently. For more information, see the SequentialAccess setting for .

  Before you close the , first close the object. You must also close the object if you plan to reuse an object. If the is created with set to CloseConnection, closing the closes the connection automatically.

  Sends the to the , and builds an using one of the values.

  An 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 data source. This requires less code than using the method, and then performing the operations that are required to generate the single value using the data returned by an .

  A typical query can be formatted as in the following C# example:

  `CommandText = "SELECT COUNT(*) FROM region"; Int32 count = (int32) 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 if the result set is empty.

  1.0.5000.0
  2.0.0.0
- Property
  System.Data.OleDb.OleDbParameterCollection To be added: an object of type 'OleDbParameterCollection'

  The OLE DB .NET Provider does not support named parameters for passing parameters to an SQL statement or a stored procedure called by an when is set to Text. In this case, the question mark (?) placeholder must be used. For example:

  SELECT * FROM Customers WHERE CustomerID = ?

  Therefore, the order in which objects are added to the must directly correspond to the position of the question mark placeholder for the parameter in the command text.

  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 the property is set to TableDirect, does nothing. 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 Size property to the maximum size needed. returns an error if these conditions are not met.

  If you call an Execute method after you call , any parameter value that is larger than the value specified by the Size 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 Size.

  Creates a prepared (or compiled) version of the command on the data source.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  The default value of the is 30 seconds.

  Resets the property to the default value.

  1.0.5000.0
  2.0.0.0
- Property
  1.0.5000.0
  2.0.0.0
  System.Data.IDbConnection To be added. To be added. To be added.
- Method
  1.0.5000.0
  System.Data.IDbDataParameter To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  System.Data.IDataReader

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this member, see .

  An object.

- Method
  1.0.5000.0
  2.0.0.0
  System.Data.IDataReader ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this member, see .

  Executes the against the , and builds an using one of the values.

  An built using one of the values.

  One of the values.
- Property
  1.0.5000.0
  2.0.0.0
  System.Data.IDataParameterCollection To be added. To be added. To be added.
- 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

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this member, see .

  A new that is a copy of this instance.

- Property
  System.Data.OleDb.OleDbTransaction To be added: an object of type 'OleDbTransaction'

  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 an object that is not connected to the same as the object, an exception is thrown the next time that you try 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 with the ), in which case the default is None.

  For more information about how to use the 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)