public void OpenAndCloseConnection() { Framework.DataServices.CommonDatabase commonDatabase = new Framework.DataServices.CommonDatabase(ConnectionName, ConnectionString, ProviderName); commonDatabase.Open(); commonDatabase.Close(); }
protected void btnTestConnection_Click(object sender, EventArgs e) { try { Framework.DataServices.CommonDatabase db = new Framework.DataServices.CommonDatabase("DBProvider"); db.Open(); db.Close(); this.lblStatusCommon.Text = "Conexão estabelecida com sucesso."; } catch (Exception ex) { this.lblStatusCommon.Text = "Erro ao estabelecer a conexão." + ex.Message; } }