OdbcFactory.Instance 字段

定义

获取一个 OdbcFactory 实例,该实例可用于检索强类型的数据对象。

public: static initonly System::Data::Odbc::OdbcFactory ^ Instance;
public static readonly System.Data.Odbc.OdbcFactory Instance;
 staticval mutable Instance : System.Data.Odbc.OdbcFactory
Public Shared ReadOnly Instance As OdbcFactory 

字段值

示例

以下代码片段使用 Instance 字段检索 OdbcFactory 实例,然后返回强类型 DbCommand 实例:

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

适用于