internal static void ConnectSQL(string instance, string dbname, string user, string password, bool savepwd) { string connString = "Server=" + instance + "; Database = " + dbname + "; user = "******"; password = "******";"; SQL = new SqlConnection(connString); SQL.Open(); ConnectedDBType = DB.SQL; if (savepwd) { AddToRecent(instance, dbname, user, password); } else { AddToRecent(instance, dbname, user); } scriptEditor = new frmScriptEditor(); scriptEditor.FormClosed += ScriptEditor_FormClosed; scriptEditor.Show(); loginForm.Hide(); }
private void menuItemInsert_Click(object sender, EventArgs e) { // insert the selected item into the script on the script editor form string objectType = ""; string objectID = ""; string IDColName = ""; frmScriptEditor editor = (frmScriptEditor)this.Owner; if (rbTags.Checked) { objectType = "tag"; IDColName = "DPDUID"; } else if (rbConn.Checked) { objectType = "conn"; IDColName = "SCUID"; } objectID = dgvFDAObjects.SelectedRows[0].Cells[dgvFDAObjects.Columns[IDColName].Index].Value.ToString(); editor.InsertFDAObject(objectID, objectType); }