Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            Accueil ss = new Accueil();

            ss.Show();
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection  Sqlcon = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\JEdhib\Documents\Dataaa.mdf;Integrated Security=True;Connect Timeout=30");
            String         query  = "select * from LOGIN where USERNAME ='******'and PASSWORD='******'";
            SqlDataAdapter sda    = new SqlDataAdapter(query, Sqlcon);
            DataTable      dt     = new DataTable();

            sda.Fill(dt);
            if (dt.Rows.Count == 1)
            {
                Accueil ss = new Accueil();
                this.Hide();
                ss.Show();
            }
            else
            {
                MessageBox.Show("Vérifier votre Identifiant et Password");
            }


            if (button1.Text == "LOGIN")
            {
                cn = new MySqlConnection("SERVER=localhost;PORT=3306;DATABASE=mabasex1;UID=root;PWD=");

                try
                {
                    if (cn.State == ConnectionState.Closed)
                    {
                        cn.Open();
                    }
                }


                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }
        }