Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir,
I am trying to retrieve image in a picturebox from datagridview.
please suggest a code.thank you
C#
string img = dataGridView1.Rows[i].Cells[20].Value;
           byte[] imagebyte = (byte[])img.ExecuteScalar();
           MemoryStream mr = new MemoryStream(imagebyte);
           mr.Seek(0, SeekOrigin.Begin);
           t.pictureBox1.Image = new Bitmap(mr);
Posted
Updated 27-Oct-13 22:56pm
v2

 
Share this answer
 
why you are trying to use such code which you have give above, it can be done simply..
first tell me, are u using C# ?? reply
 
Share this answer
 
Comments
Thomas Daniels 28-Oct-13 4:56am    
Please don't post this as an answer: post this as a comment instead. Click on the "Have a Question or Comment?" button and then, you can post your comment.
Md Shahbaz Khan 28-Oct-13 5:19am    
good, i am new, thats why dont know how to do stufs here, but thanks for informing
Member 10358986 28-Oct-13 4:59am    
yes sir i am using C# and making a window application using access database

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900