Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection  conn = new SqlConnection(@"Data Source=DESKTOP-C339597\COUNDOULT;Initial Catalog=Gestioncommerciale;Integrated Security=True");
            SqlDataAdapter sda  = new SqlDataAdapter("select count(*) from Utilisateur where Login = '******' and Password = '******'", conn);
            DataTable      dt   = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                article mm = new article();
                mm.Show();
            }
            else
            {
                MessageBox.Show(" please enter correct login and password", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }