Skip to content

Error during image retrieving from data base

Mks Khalid

Mks Khalid

Asked Jun 27, 2014, 11:49 PM EDT1 answer
Share
LinkedInX
hey i  m using the following code to display image from database it give an errro
Java
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;

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.