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

            hm.ShowDialog();
        }
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            this.Hide();
            HOME hm = new HOME();

            hm.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection  xConn = new SqlConnection("Server=DESKTOP-467UO53\\SQLEXPRESS;DataBase=CIMS;UID=sa;PWD=123");
            string         str   = "Select * from tblLogin where Username ='******' and Pass ='******'";
            SqlDataAdapter sda   = new SqlDataAdapter(str, xConn);
            DataTable      dt    = new DataTable();

            sda.Fill(dt);

            if (dt.Rows.Count == 1)
            {
                this.Hide();
                HOME obj2 = new HOME();
                obj2.ShowDialog();
            }
            else
            {
                MessageBox.Show("Invalid username and Password.");
            }
        }