Verify Trainer


SUBMITTED BY: Guest

DATE: Nov. 21, 2013, 12:24 a.m.

FORMAT: Text only

SIZE: 1.5 kB

HITS: 1157

  1. SqlCommand sqlcmd = new SqlCommand("select * from stagiaire where Id_stagiaire=@Id_stagiaire", sqlcon);
  2. SqlParameter sqlpr1 = new SqlParameter();
  3. sqlpr1.ParameterName = "@Id_stagiaire";
  4. sqlpr1.DbType = System.Data.DbType.Int16;
  5. sqlpr1.Direction = System.Data.ParameterDirection.Input;
  6. sqlpr1.Value = this.txtID.Text.ToString();
  7. sqlcmd.Parameters.Add(sqlpr1);
  8. sqlcon.Open();
  9. sqldr = sqlcmd.ExecuteReader();
  10. if (sqldr.Read())
  11. {
  12. this.txtNom.Text = sqldr.GetString(1).ToString();
  13. this.txtPrenom.Text = sqldr.GetString(2).ToString();
  14. this.CmbSp.Text = sqldr.GetString(3).ToString();
  15. if (sqldr.GetString(4).ToString()=="Feminin")
  16. this.OppFemale.Checked=true;
  17. else
  18. {
  19. this.oppMale.Checked=true;
  20. }
  21. this.txtAdrs.Text = sqldr.GetString(5).ToString();
  22. this.dateTimePicker1.Value = sqldr.GetDateTime(6);
  23. }
  24. else
  25. { MessageBox.Show("Ce ID Stagiaire N'existe pas dans la list des Stagiaires !");
  26. }
  27. sqlcon.Close();

comments powered by Disqus