/// <summary>
 /// Load the text boxes from the given conncetion
 /// </summary>
 public void LoadConnection(Connection c)
 {
     txtName.Text = c.Name;
       txtUser.Text = c.User;
       txtPass.Text = c.Pass;
       txtHost.Text = c.Host;
       txtPort.Text = c.Port;
       txtSid.Text = c.Sid;
       txtService.Text = c.Service;
 }
 /// <summary>
 /// Get the connection details from the dialog controls in the format of a connection class
 /// </summary>
 public void SaveConnection(Connection c)
 {
     c.Name = txtName.Text.Trim();
       c.User = txtUser.Text.Trim();
       c.Pass = txtPass.Text.Trim();
       c.Host = txtHost.Text.Trim();
       c.Port = txtPort.Text.Trim();
       c.Sid = txtSid.Enabled ? txtSid.Text.Trim() : "";
       c.Service = txtService.Enabled ? txtService.Text.Trim() : "";
 }
 private void treeConnections_DoubleClick(object sender, EventArgs e)
 {
     // Did they double click anything important?
       TreeNode node = treeConnections.SelectedNode;
       if (node.Tag is Table)
       {
     // Open up the table in the query screen
     Table t = (Table)(node.Tag);
     txtQuery.Text = "select * from " + t.ParentSchema.Name + "." + t.Name;
     lblConn.Text = "Connection: " + t.ParentSchema.ParentConnection.Name;
     selected_conn = t.ParentSchema.ParentConnection;
     txtQuery.Enabled = true;
     gridOutput.Enabled = true;
     bnExecute.Enabled = true;
     Application.DoEvents(); // show the updates from above
     bnExecute_Click(null, null);
       }
 }
 private void bnNew_Click(object sender, EventArgs e)
 {
     EditConnection ec = new EditConnection();
       if (ec.ShowDialog() == DialogResult.OK)
       {
     Connection c = new Connection();
     ec.SaveConnection(c);
     TreeNode n = new TreeNode(c.Name);
     n.ImageIndex = 1;
     n.SelectedImageIndex = 1;
     n.Tag = c;
     n.Nodes.Add(loading);
     treeConnections.Nodes.Add(n);
     connections.Add(c);
       }
 }
Exemple #5
0
 public Schema(Connection Parent)
 {
     ParentConnection = Parent;
 }