public static string Connect(string InitialConStr = "")
        {
            try
            {
                var frm = new OracleConnectorDialog();
                if (InitialConStr.IsEmpty())
                {
                    frm.rdBasic.Checked = true;
                }
                else
                {
                    frm.rdConStr.Checked  = true;
                    frm.pnlBasic.Enabled  = false;
                    frm.pnlConStr.Enabled = true;
                    frm.tbFullConStr.Text = InitialConStr;
                }

                var dlgRes = frm.ShowDialog();
                return(frm.SelectedConnectionString);
            }
            catch (Exception ex)
            {
                ControlMod.PromptMsg(ex);
            }
            return("");
        }
Exemple #2
0
 private void btnConnect_Click(object sender, EventArgs e)
 {
     try
     {
         var sInput = OracleConnectorDialog.Connect(OracleHelper.constr); // ControlMod.InputBox("Enter connection string", "Enter connection string", OracleHelper.constr);
         if (sInput.NotEmpty())
         {
             DoWait(true);
             OracleHelper.constr = sInput;
             using (var con = new OracleConnection(OracleHelper.constr))
             {
                 var owners = DBHelper.ExecuteQuery <string>(OracleHelper.owners, con).Select(o => new { id = o }).ToList();
                 ControlMod.FillCombo(cmbData, owners, "id", "id");
             }
         }
     }
     catch (Exception ex)
     {
         ex.PromptMsg();
     }
     DoWait(false);
 }