共用方式為


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

適用於