OleDbFactory.Instance 字段

定义

获取 OleDbFactory 的实例。 它可用于检索强类型的数据对象。

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

字段值

示例

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

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

适用于