Share via


OleDbFactory.CreateConnection Yöntem

Tanım

Kesin türe sahip DbConnection bir örnek döndürür.

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

Döndürülenler

Türü kesin olarak belirlenmiş yeni bir DbConnectionörneği.

Örnekler

Aşağıdaki kod parçası kesin türe sahip DbConnection bir örnek döndürür:

Dim newFactory As OleDbFactory = OleDbFactory.Instance
Dim cmd As DbConnection = newFactory.CreateConnection()
OleDbFactory newFactory = OleDbFactory.Instance;
DbConnection cmd = newFactory.CreateConnection();

Şunlara uygulanır