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();

适用于