コード例 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            this.Hide();
            WelcomeOE vc = new WelcomeOE();

            vc.Show();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection  con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Bhagya Udayanandani\Documents\Data.mdf;Integrated Security=True;Connect Timeout=30");
            SqlDataAdapter sda = new SqlDataAdapter("Select count(*) from Ologin where Username='******'and Password='******'", con);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                WelcomeOE a = new WelcomeOE();
                a.Show();
            }
            else
            {
                MessageBox.Show("Please check your password and username");
            }
        }