Im retrieving pictures from database, i want to display it to picturebox. getting exception "Not a valid parameter"
i already google it, and almost of it not solve my problem.
while (reader.Read())
{
byte[] data = (Byte[])reader["P1"];
MemoryStream mStream = new MemoryStream();
mStream.Write(data, 0, Convert.ToInt32(data.Length));
Bitmap bm = new Bitmap(mStream, false);
mStream.Dispose();
pictureBox1.Image = bm;
}
Its having an error on "Bitmap bm = new Bitmap(mStream, false);" is there something wrong with my data from the ms access database?