Compartilhar via


SqlClientFactory.CreateConnection Método

Definição

Retorna uma instância DbConnection fortemente tipada.

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

Retornos

Uma nova instância fortemente tipada de DbConnection.

Exemplos

O fragmento de código a seguir retorna uma instância fortemente tipada DbConnection :

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

Aplica-se a

Confira também