OracleClientFactory.CreateConnection 方法

定义

返回强类型的 DbConnection 实例。

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

返回

DbConnection 的新强类型实例。

示例

以下代码片段返回强类型 DbConnection 实例。

Dim newFactory As OracleClientFactory = OracleClientFactory.Instance  
Dim connection As DbConnection = newFactory.CreateConnection()  
OracleClientFactory newFactory = OracleClientFactory.Instance;  
DbConnection connection = newFactory.CreateConnection();  

适用于