private void button4_Click(object sender, EventArgs e)
        {
            HomeForm home = new HomeForm();

            home.Show();
            this.Hide();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Con.Open();
            SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) from UserTbl where Uname ='" + UnameTb.Text + "' and Upassword = '******'", Con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                HomeForm home = new HomeForm();
                home.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Wrong UserName Or Password");
            }
            Con.Close();
        }