hey i m using the following code to display image from database it give an errro
error=paramer is not valid
MemoryStream stream = new MemoryStream();
con.Open();
SqlCommand command = new SqlCommand("select image from loll", con);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
con.Close();
Bitmap bitmap = new Bitmap(stream);
pictureBox1.Image = bitmap;

Guest UserPosted Jun 30, 2014, 11:53 PM
Some suggestions:-
- What's the data type of field in db?
- You're loading all images using 'select image from loll', if there are multiple images coming you're code might break, so reduce it to say 'select image from loll where id=1'
- Refer this code base for more details
http://www.aspsnippets.com/Articles/Display-Images-from-SQL-Server-Database-using-ASP.Net.aspx
thnx
@sumitjolly