Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to show image in image control from database in asp.net
Posted

con.Open();
cmd = new OleDbCommand("select product_img from purchase where Model_no='" + comboBox2.Text + "'", con);
da = new OleDbDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
byte[] MyData = new byte[0];
DataRow myRow;
myRow = ds.Tables[0].Rows[0];
MyData = (byte[])myRow[0];
MemoryStream stream = new MemoryStream(MyData);
pictureBox1.Image = Image.FromStream(stream);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;

con.Close();
 
Share this answer
 
Check this links..

Example 1[^]

Example 2[^]


Regards

Dil
 
Share this answer
 
 
Share this answer
 

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