Bagikan melalui


OdbcFactory.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 OdbcFactory = OdbcFactory.Instance
Dim cmd As DbConnection = newFactory.CreateConnection()
OdbcFactory newFactory = OdbcFactory.Instance;
DbConnection cmd = newFactory.CreateConnection();

Berlaku untuk