Bagikan melalui


OleDbFactory.CreateConnection Metode

Definisi

Mengembalikan instans yang ditik DbConnection dengan kuat.

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

Mengembalikan

Instans baru yang dititik kuat dari DbConnection.

Contoh

Fragmen kode berikut mengembalikan instans yang sangat ditik DbConnection :

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

Berlaku untuk