ma ouml

ma ouml

  • NA
  • 436
  • 88.4k

How to solve the connection problem in the datagridview c#

Jun 20 2017 6:57 PM
 
Hi friends
I find this error
 
 
 
in this code but I do not know is what I will add con.open () and con .close () to the code
 
 
Program.cmd.CommandText = "select utilisateur.User_name,site.Libelle_site,profil.Libelle_profil from utilisateur,site,profil,autorisation where utilisateur.Id_user=autorisation.Id_user and site.Id_site=autorisation.Id_site and profil.Id_profil=autorisation.Id_profil";
Program.dr = Program.cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(Program.dr);
dataGridView1.DataSource = dt;
dataGridView1.Refresh();
 

Answers (8)