2
Answers

datagrid view is not showing images

asad ahmad

asad ahmad

8y
218
1
while(rdr.Read())
{
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
ImageConverter ic;
Image img;
Byte[] cbyte;
ic = new ImageConverter();
cbyte = (Byte[])(rdr["Imge"]);
img = (Image)ic.ConvertFrom(cbyte);
Bitmap a = new Bitmap(img);
iconColumn.Image = a;
iconColumn.Name = "Tree";
iconColumn.HeaderText = "Nice tree";
dataGridView1.Columns.Insert(0, iconColumn);
};
Answers (2)