Hi,
Do you mean you want to show image in the control like picture box? You can get the image using MemoryStream object.
Please refer to the following links.
1. How To Display an Image from a Database in a Windows Forms PictureBox by Using Visual Basic .NET
http://support.microsoft.com/kb/321900/en-us
2. HOW TO: Copy a Picture from a Database Directly to a PictureBox Control with Visual C#
http://support.microsoft.com/kb/317701/en-us
If you bind datasource which contains image column to datagridview, set the datasource will be ok.
conn = new SqlConnection("Data Source=.;user = sa;password = sa;database = factory");
SqlCommand comm = new SqlCommand();
comm.Connection = conn;
comm.CommandText = "select name, image from imagetest";
adapter = new SqlDataAdapter(comm);
adapter.Fill(dt1);
dataGridView1.DataSource = dt1;
// add another imageColumn
DataGridViewImageColumn img = new DataGridViewImageColumn();
img.DataPropertyName = "image";
img.Name = "test";
dataGridView1.Columns.Add(img);
// bind image to picturebox
pictureBox1.DataBindings.Add("image",dt1,"image",true);
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.