Pages

datagridview imbriqué dans un tabcontrol sujet

mercredi 26 mars 2014




bonsoir
je suis débutante avec c# et je suis entrain de developper une application windows form

je cherche a recuperer les valeurs de ma table de base de donnée dans un datagridview qui est imbriqué dans un tabControl mais rien ne s'affiche malgré que lorsque je met le datagridview directemet dans le form ça marche aucun probléme

[CODE = c#]conn = new SqlConnection("Data Source=USER-PC\SQLEXPRESS;Initial Catalog=MM_DataBase;Integrated Security=True");
cmd = new SqlCommand("select nom,prenom,Adresse,eMail from etudiant", conn);
try {
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = cmd;
DataTable madata=new DataTable();
sda.Fill(madata);
BindingSource bSource = new BindingSource();
bSource.DataSource = madata;
dataGridView1.DataSource = bSource;
sda.Update(madata);
}catch(Exception ex){
MessageBox.Show(ex.Message);
}[/CODE]




2 commentaires:

  1. Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.

    RépondreSupprimer
  2. Bags crafted exquisitely from leather are robust, handy, spacious that spell comfort and style.

    RépondreSupprimer