private void login_click(object sender, EventArgs e)
        {
            cmd.Connection  = con;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "loginCheck";

            cmd.Parameters.Add("@name", SqlDbType.VarChar).Value     = user_text.Text;
            cmd.Parameters.Add("@password", SqlDbType.VarChar).Value = pass_text.Text;

            // cmd = new SqlCommand("select * from user_info where username = '******'and password = '******' ", con);
            con.Open();

            int Count = 0;

            cmd.ExecuteNonQuery();
            DataTable dt = new DataTable();

            adapt = new SqlDataAdapter(cmd);
            adapt.Fill(dt);

            Count = Convert.ToInt32(dt.Rows.Count.ToString());

            if (Count == 1)
            {
                this.Hide();
                MDIParent1 mu = new MDIParent1();
                mu.Show();
            }
            else
            {
                MessageBox.Show("Please enter correct username and password.");
            }

            con.Close();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            MDIParent1 p = new MDIParent1();

            p.Show();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Class1        c     = new Class1();
            SqlDataReader dr    = c.readrecord("select * from Login where username='******'and password='******'");
            int           count = 0;

            while (dr.Read())
            {
                count = count + 1;
            }
            if (count == 1 && textBox3.Text == number.ToString())
            {
                MessageBox.Show("Successfully Logged In ", "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                this.Hide();
                MDIParent1 p = new MDIParent1();
                p.Show();
            }
            else
            {
                MessageBox.Show("Check Your Username and Password or Captcha", "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Error);
                loadcaptcha();
            }
            textBox1.Text = textBox2.Text = textBox3.Text = null;
        }