DbCommand 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示要針對數據源執行的 SQL 語句或預存程式。 提供代表命令之資料庫特定類別的基類。 ExecuteNonQueryAsync。
public ref class DbCommand abstract : IDisposable
public ref class DbCommand abstract : System::ComponentModel::Component, IDisposable, System::Data::IDbCommand
public ref class DbCommand abstract : System::ComponentModel::Component, System::Data::IDbCommand
public ref class DbCommand abstract : System::ComponentModel::Component, IAsyncDisposable, System::Data::IDbCommand
public abstract class DbCommand : IDisposable
public abstract class DbCommand : System.ComponentModel.Component, IDisposable, System.Data.IDbCommand
public abstract class DbCommand : System.ComponentModel.Component, System.Data.IDbCommand
public abstract class DbCommand : System.ComponentModel.Component, IAsyncDisposable, System.Data.IDbCommand
type DbCommand = class
interface IDisposable
type DbCommand = class
inherit Component
interface IDbCommand
interface IDisposable
type DbCommand = class
inherit Component
interface IDbCommand
interface IDisposable
interface IAsyncDisposable
Public MustInherit Class DbCommand
Implements IDisposable
Public MustInherit Class DbCommand
Inherits Component
Implements IDbCommand, IDisposable
Public MustInherit Class DbCommand
Inherits Component
Implements IDbCommand
Public MustInherit Class DbCommand
Inherits Component
Implements IAsyncDisposable, IDbCommand
- 繼承
-
DbCommand
- 繼承
- 衍生
- 實作
建構函式
| 名稱 | Description |
|---|---|
| DbCommand() |
建構物件 DbCommand 的實例。 |
屬性
| 名稱 | Description |
|---|---|
| CanRaiseEvents |
會得到一個值,表示該元件是否能引發事件。 (繼承來源 Component) |
| CommandText |
接收或設定文字指令來對資料來源執行。 |
| CommandTimeout |
在終止執行指令並產生錯誤前,先取得或設定等待時間(以秒為單位)。 |
| CommandType |
取得或設定該屬性的 CommandText 解讀方式。 |
| Connection |
得到或設定 由 DbConnection 所使用 DbCommand。 |
| Container |
得到 IContainer 包含 Component的 。 (繼承來源 Component) |
| DbConnection |
得到或設定 由 DbConnection 所使用 DbCommand。 |
| DbParameterCollection |
取得物品集合 DbParameter 。 |
| DbTransaction |
取得或設定該DbTransaction物件執行的內部。DbCommand |
| DesignMode |
會得到一個值,表示目前 Component 是否處於設計模式。 (繼承來源 Component) |
| DesignTimeVisible |
取得或設定一個值,指示指令物件是否應該在自訂介面控制項中顯示。 |
| Events |
會取得與此 Component連結的事件處理程序清單。 (繼承來源 Component) |
| Parameters |
取得物品集合 DbParameter 。 欲了解更多參數資訊,請參閱 「參數配置與參數資料型別」。 |
| Site | (繼承來源 Component) |
| Transaction |
取得或設定該DbTransaction物件執行的內部。DbCommand |
| UpdatedRowSource |
當 Update 方法DbDataAdapter使用時,指令結果如何套用DataRow或設定 。 |
方法
事件
| 名稱 | Description |
|---|---|
| Disposed |
當元件被呼叫方法 Dispose() 時會發生。 (繼承來源 Component) |
明確介面實作
| 名稱 | Description |
|---|---|
| IDbCommand.Connection |
取得或設定 IDbConnection 此實例 IDbCommand所使用的。 |
| IDbCommand.CreateParameter() |
建立一個新的物件實例 IDbDataParameter 。 |
| IDbCommand.ExecuteReader() |
執行 對 CommandText 並 Connection 構建 IDataReader。 |
| IDbCommand.ExecuteReader(CommandBehavior) |
對 執行 ,CommandTextConnection並利用其中一個IDataReader值建立 CommandBehavior 。 |
| IDbCommand.Parameters | |
| IDbCommand.Transaction |
取得或設定該DbTransaction物件執行的內部。DbCommand |
擴充方法
| 名稱 | Description |
|---|---|
| ConfigureAwait(IAsyncDisposable, Boolean) |
設定如何執行從異步可處置專案傳回的工作等候。 |