DataCommand 類別
提供建立和執行各種型別的資料命令物件資料來源並擷取唯讀結果或命令狀態碼。
繼承階層架構
Object
Microsoft.VisualStudio.Data.Framework.DataSiteableObject<IVsDataConnection>
Microsoft.VisualStudio.Data.Framework.DataCommand
命名空間: Microsoft.VisualStudio.Data.Framework
組件: Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)
語法
'宣告
Public MustInherit Class DataCommand _
Inherits DataSiteableObject(Of IVsDataConnection) _
Implements IVsDataCommand
public abstract class DataCommand : DataSiteableObject<IVsDataConnection>,
IVsDataCommand
public ref class DataCommand abstract : public DataSiteableObject<IVsDataConnection^>,
IVsDataCommand
[<AbstractClass>]
type DataCommand =
class
inherit DataSiteableObject<IVsDataConnection>
interface IVsDataCommand
end
public abstract class DataCommand extends DataSiteableObject<IVsDataConnection> implements IVsDataCommand
DataCommand 類型會公開下列成員。
建構函式
名稱 | 描述 | |
---|---|---|
![]() |
DataCommand() | 初始化 DataCommand 類別的新執行個體。 |
![]() |
DataCommand(IVsDataConnection) | 與資料連接物件來初始化 DataCommand 類別的新執行個體。 |
回頁首
屬性
名稱 | 描述 | |
---|---|---|
![]() |
Site | 取得或設定物件的網站。 (繼承自 DataSiteableObject<T>)。 |
回頁首
方法
回頁首
事件
名稱 | 描述 | |
---|---|---|
![]() |
SiteChanged | 在 Site 屬性變更時發生。 (繼承自 DataSiteableObject<T>)。 |
回頁首
備註
資料設計工具 Extensibility (DDEX) 提供者可以執行命令的各種型別的物件資料來源。 這可能不包含,,但只限於, SQL 陳述式、程序及函式呼叫。 它們可能也會公開能力和衍生參數和結構描述為命令準備。
DataCommand 類別中所引入命令類型。 命令型別表示特定命令字串的程式設計說明。 例如,命令型別文字可能會通知 DDEX 提供者命令字串是應該直接執行的 SQL 陳述式。 或者, TabularFunction 命令類型可能會通知 DDEX 提供者命令字串是應該執行使用適當的方法,資料表值函式的名稱。
基礎技術 (例如開放式資料庫連接 (Open Database Connectivity,ODBC), OLE DB 和 ADO.NET 嘗試列舉一組允許命令型別,通常為純文字,以資料表形式出現,或是以預存程序。 DataCommand 類別是透過將寬這類命令型別來自 Pin 列舉的需要擴充這個概念。 這可以讓 DDEX 提供者與描述如何及何時將自訂命令類型提供彈性,才能使用命令。
![]() |
---|
若要提供命令執行非同步功能,請使用 DataAsyncCommand 類別。這個類別具有與 DataCommand 中包含的類別的一組方法,不過,這些方法會以非同步方式。 |
繼承者注意事項
當您從 DataCommand 類別繼承時,必須覆寫從要由其 DDEX 提供者實作支援之類別的每個方法。 每個方法的基底實作這個類別會擲回 NotSupportedException。
請注意 ExecuteWithoutResults 方法有一個基底實作委派給 Execute 方法。
執行緒安全
這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員是安全執行緒。