DbCommand 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示要针对数据源执行的 SQL 语句或存储过程。 为表示命令的数据库特定类提供基类。 ExecuteNonQueryAsync。
public ref class DbCommand abstract : IDisposablepublic ref class DbCommand abstract : System::ComponentModel::Component, IAsyncDisposable, IDisposable, System::Data::IDbCommandpublic ref class DbCommand abstract : IDisposable, System::Data::IDbCommandpublic ref class DbCommand abstract : System::ComponentModel::Component, IDisposable, System::Data::IDbCommandpublic ref class DbCommand abstract : System::ComponentModel::Component, System::Data::IDbCommandpublic ref class DbCommand abstract : System::ComponentModel::Component, IAsyncDisposable, System::Data::IDbCommandpublic abstract class DbCommand : IDisposablepublic abstract class DbCommand : System.ComponentModel.Component, IAsyncDisposable, IDisposable, System.Data.IDbCommandpublic abstract class DbCommand : IDisposable, System.Data.IDbCommandpublic abstract class DbCommand : System.ComponentModel.Component, IDisposable, System.Data.IDbCommandpublic abstract class DbCommand : System.ComponentModel.Component, System.Data.IDbCommandpublic abstract class DbCommand : System.ComponentModel.Component, IAsyncDisposable, System.Data.IDbCommandtype DbCommand = class
    interface IDisposabletype DbCommand = class
    inherit Component
    interface IDbCommand
    interface IDisposable
    interface IAsyncDisposabletype DbCommand = class
    interface IDbCommand
    interface IDisposabletype DbCommand = class
    inherit Component
    interface IDbCommand
    interface IDisposablePublic MustInherit Class DbCommand
Implements IDisposablePublic MustInherit Class DbCommand
Inherits Component
Implements IAsyncDisposable, IDbCommand, IDisposablePublic MustInherit Class DbCommand
Implements IDbCommand, IDisposablePublic MustInherit Class DbCommand
Inherits Component
Implements IDbCommand, IDisposablePublic MustInherit Class DbCommand
Inherits Component
Implements IDbCommandPublic MustInherit Class DbCommand
Inherits Component
Implements IAsyncDisposable, IDbCommand- 继承
- 
				DbCommand
- 继承
- 派生
- 实现
构造函数
| DbCommand() | 构造 DbCommand 对象的实例。 | 
属性
| CanRaiseEvents | 获取一个值,该值指示组件是否可以引发事件。(继承自 Component) | 
| CommandText | 获取或设置要针对数据源运行的文本命令。 | 
| CommandTimeout | 获取或设置在终止尝试执行命令并生成错误之前(以秒为单位)的等待时间。 | 
| CommandType | 获取或设置如何解释 CommandText 属性。 | 
| Connection | 获取或设置此 DbCommand使用的 DbConnection。 | 
| Container | 获取包含 Component的 IContainer。(继承自 Component) | 
| DbConnection | 获取或设置此 DbCommand使用的 DbConnection。 | 
| DbParameterCollection | 获取 DbParameter 对象的集合。 | 
| DbTransaction | 获取或设置执行此 DbCommand 对象的 DbTransaction。 | 
| DesignMode | 获取一个值,该值指示 Component 当前是否处于设计模式。(继承自 Component) | 
| DesignTimeVisible | 获取或设置一个值,该值指示命令对象是否应在自定义接口控件中可见。 | 
| Events | 获取附加到此 Component的事件处理程序的列表。(继承自 Component) | 
| Parameters | 获取 DbParameter 对象的集合。 有关参数的详细信息,请参阅 配置参数和参数数据类型。 | 
| Site | (继承自 Component) | 
| Transaction | 获取或设置执行此 DbCommand 对象的 DbTransaction。 | 
| UpdatedRowSource | 获取或设置 DbDataAdapterUpdate 方法使用命令结果时如何应用于 DataRow。 | 
方法
事件
| Disposed | 当组件通过调用 Dispose() 方法释放时发生。(继承自 Component) | 
显式接口实现
| IDbCommand.Connection | 获取或设置此 IDbCommand实例使用的 IDbConnection。 | 
| IDbCommand.CreateParameter() | 创建 IDbDataParameter 对象的新实例。 | 
| IDbCommand.ExecuteReader() | 针对 Connection 执行 CommandText 并生成 IDataReader。 | 
| IDbCommand.ExecuteReader(CommandBehavior) | 针对 Connection执行 CommandText,并使用其中一个 CommandBehavior 值生成 IDataReader。 | 
| IDbCommand.Parameters | |
| IDbCommand.Transaction | 获取或设置执行此 DbCommand 对象的 DbTransaction。 | 
扩展方法
| ConfigureAwait(IAsyncDisposable, Boolean) | 配置如何执行从异步可释放项返回的任务的 await。 |