Esempio n. 1
0
        void btnNew_Click(object sender, EventArgs e)
        {
            string uid        = "";
            string pwd        = "";
            string connString = "";

            if (CheckUserName(out uid, out pwd))
            {
                if (rdWinAuth.Checked)
                {
                    connString = string.Format("server={0};Integrated Security='SSPI';", cboServers.Text);
                }
                else
                {
                    connString = string.Format("server={0};uid={1};pwd={2}", cboServers.Text, uid, pwd);
                }

                NewDb nd = new NewDb(cboServers.Text, connString);
                nd.ShowDialog();
                if (nd.DialogResult == DialogResult.OK)
                {
                    cboDbs.Items.Add(nd.dbName);
                    cboDbs.SelectedText = nd.dbName;
                }
                nd.Dispose();
            }
        }
Esempio n. 2
0
        void btnNew_Click(object sender, EventArgs e)
        {
            string uid = "";
              string pwd = "";
              string connString = "";
              if (CheckUserName(out uid, out pwd)) {
            if (rdWinAuth.Checked)
              connString = string.Format("server={0};Integrated Security='SSPI';", cboServers.Text);
            else
              connString = string.Format("server={0};uid={1};pwd={2}", cboServers.Text, uid, pwd);

            NewDb nd = new NewDb(cboServers.Text, connString);
            nd.ShowDialog();
            if (nd.DialogResult == DialogResult.OK) {
              cboDbs.Items.Add(nd.dbName);
              cboDbs.SelectedText = nd.dbName;
            }
            nd.Dispose();

              }
        }