共用方式為


OleDbFactory.CreateCommand 方法

定義

傳回強型別 DbCommand 執行個體。

public:
 override System::Data::Common::DbCommand ^ CreateCommand();
public override System.Data.Common.DbCommand CreateCommand ();
override this.CreateCommand : unit -> System.Data.Common.DbCommand
Public Overrides Function CreateCommand () As DbCommand

傳回

DbCommand 的新強型別執行個體。

範例

下列代碼段會傳回強型別 DbCommand 實例:

Dim newFactory As OleDbFactory = OleDbFactory.Instance
Dim cmd As DbCommand = newFactory.CreateCommand()
OleDbFactory newFactory = OleDbFactory.Instance;
DbCommand cmd = newFactory.CreateCommand();

適用於