共用方式為


OdbcFactory.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 OdbcFactory = OdbcFactory.Instance
Dim cmd As DbCommand = newFactory.CreateCommand()
OdbcFactory newFactory = OdbcFactory.Instance;
DbCommand cmd = newFactory.CreateCommand();

適用於