Delete Trainer


SUBMITTED BY: Guest

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

FORMAT: Text only

SIZE: 781 Bytes

HITS: 903

  1. SqlCommand sqlcmd = new SqlCommand("delete from stagiaire where Id_stagiaire = @Id_stagiaire", sqlcon);
  2. SqlDataReader sqldr;
  3. sqlpr1 = new SqlParameter();
  4. sqlpr1.ParameterName = "@Id_stagiaire";
  5. sqlpr1.DbType = System.Data.DbType.Int16;
  6. sqlpr1.Direction = System.Data.ParameterDirection.Input;
  7. sqlpr1.Value = this.txtID.Text;
  8. sqlcmd.Parameters.Add(sqlpr1);
  9. if (this.txtID.Text == "") MessageBox.Show("Le Champ de Identifiant est vide!");
  10. else
  11. sqlcon.Open();
  12. sqlcmd.ExecuteNonQuery();
  13. MessageBox.Show("Supprimer Avec Succès !");
  14. sqlcon.Close();

comments powered by Disqus