Ahmet Taha

Ahmet Taha

  • 1.7k
  • 381
  • 8.7k

cannot display image in data gridview

Mar 9 2021 8:11 AM
hello guys, could anyone fix my problem the image cannot display in datagridview
 
this is my source code for this
 
int i = 0;
dataGridView1.Rows.Clear();
cn.Open();
cmd = new SqlCommand("select *from tblNewStudentEntry where status like 'Active'", cn);
dr = cmd.ExecuteReader();
while (dr.Read())
{
i++;
dataGridView1.Rows.Add(i, dr["academicyear"].ToString(), dr["currentglevel"].ToString(), dr["strand"].ToString(), dr["section"].ToString(), dr["lrn"].ToString(), dr["Photo"].ToString(), dr["lname"].ToString(), dr["fname"].ToString(), dr["mname"].ToString(),DateTime.Parse( dr["bdate"].ToString()).ToShortDateString(), dr["age"].ToString(), dr["birthplace"].ToString(), dr["studcontactno"].ToString(), dr["gender"].ToString());
}
dr.Close();
cn.Close();
 

Answers (4)