Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            studentlogin sl = new studentlogin();

            sl.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from student_login where username='******' and password='******'";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(dt);
            count = Convert.ToInt32(dt.Rows.Count.ToString());
            if (count == 0)
            {
                MessageBox.Show("Invalid Username or Password");
                studentlogin sl = new studentlogin();
                sl.Show();
            }
            else
            {
                this.Hide();
                mdi_student ms = new mdi_student();
                ms.Show();
            }
        }