private void Connect() { // TODO: colour and prescript connDetails = new ConnectionDetails(txtName.Text, txtHost.Text, int.Parse(txtPort.Text), txtSid.Text, txtUser.Text, txtPassword.Text, null, Color.Transparent); Settings.Default.Connections.Remove(connDetails.Name); Settings.Default.Connections.Add(connDetails.Name, connDetails); Settings.Default.Save(); Close(); }
/// <summary> /// Connects to the database. /// </summary> /// <param name="connDetails"></param> public SqlRunner(ConnectionDetails connDetails) { this.connDetails = connDetails; string connStr = GetConnectionString(); log.Info("connecting to [" + connDetails.Name + "] with connection string " + connStr); conn = new OracleConnection(connStr); conn.Open(); currentTransaction = conn.BeginTransaction(); }
private void SetConnectionDetailsFromSelectedItem() { if (lstConnections.SelectedItems.Count == 1) { ConnectionDetails = (ConnectionDetails)Settings.Default.Connections[lstConnections.SelectedItems[0].Tag]; } }
private void btnCancel_Click(object sender, EventArgs e) { connDetails = null; Close(); }