1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| private void txtCode_Utilisateur_TextChanged(object sender, System.EventArgs e)
{
cn = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\BD_gestion_HS.mdb;Persist Security Info=False");
cmd = new System.Data.OleDb.OleDbCommand();
cmd1 = new System.Data.OleDb.OleDbCommand();
cmd.Connection = cn;
cmd1.Connection = cn;
cmd.CommandText= " SELECT Nom FROM T_Personnel WHERE Code_Utilisateur= "+ txtCode_Utilisateur.Text +" ;";
cmd1.CommandText=" SELECT Code_Utilisateur FROM T_Personnel;";
cn.Open();
rd = cmd.ExecuteReader();
while (rd.Read())
{
txtNom.Text=(""+rd.GetString(0));
}
int rd1=cmd1.ExecuteNonQuery();
while( rd1 != int.Parse("+ txtCode_Utilisateur.Text +"))
txtNom.Text= "X";
rd.Close();
cn.Close();
} |
Partager