The user’s photo are stored in an SQL table in a binary column.
I retrieve this binary data into a dataset.
How can I display this data as a a photo in a picturebox?
I tried this, but it doesn’t work 🙁
array<byte>^ byteBLOBData = gcnew array<byte>(200);
byteBLOBData = (array<byte>^)( dataSet->Tables[ 0 ]->Rows[ 0 ]->ItemArray[ 7 ] );
System::IO::MemoryStream^ stmBLOBData = gcnew System::IO::MemoryStream(byteBLOBData );
pictureBox1->Image = Image::FromStream( stmBLOBData );
Unfortunately I got an exception :”Parameter is not valid”
I found the error. In my database the was stored wrong. I corrected it, and now it is working fine.
Thanks!