Exemple #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     DBconn.OpenConnection();
     conn = DBconn.connection;
     DBconn.CloseConnection();
     logInPrompt();
 }
Exemple #2
0
        private void textBoxServer_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (dbc.sqlConnect.State == ConnectionState.Closed)
                {
                    dbc = new DBConnect(textBoxServer.Text, textBoxDB.Text, textBoxUID.Text, textBoxPassword.Text, tbTable.Text);
                    if (dbc.OpenConnection())
                    {
                        this.Width  = 385;
                        this.Height = 330;
                        SwitchComponents();
                    }
                }
                else if (dbc.sqlConnect.State == ConnectionState.Open)
                {
                    if (tbAge.TextLength > 0)
                    {
                        dbc.Insert(textBoxServer.Text, Int32.Parse(tbAge.Text));
                    }
                    else
                    {
                        dbc.Insert(textBoxServer.Text, 0);
                    }
                }


                ClearBoxes();
            }
        }
Exemple #3
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            dbc = new DBConnect(textBoxServer.Text, textBoxDB.Text, textBoxUID.Text, textBoxPassword.Text, tbTable.Text);
            if (dbc.OpenConnection())
            {
                this.Width  = 385;
                this.Height = 330;
                SwitchComponents();
            }

            ClearBoxes();
        }
Exemple #4
0
        private void textBoxPassword_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                dbc = new DBConnect(textBoxServer.Text, textBoxDB.Text, textBoxUID.Text, textBoxPassword.Text, tbTable.Text);
                if (dbc.OpenConnection())
                {
                    this.Width  = 385;
                    this.Height = 330;
                    SwitchComponents();
                }

                ClearBoxes();
            }
        }