Read a picture from Access DB into PictureBox

前端 未结 5 1846
情深已故
情深已故 2021-01-20 17:33

I have been trying to read a picture saved in Access DB as a OLE object in a PictureBox in a C# windows Application.

The code that does this is presented below:

5条回答
  •  一生所求
    2021-01-20 18:19

    Your bytestream is corrupted somehow, becouse I tried the exact method of yours but filled the byte array with PNG data from a file instead.

    I would suggest creating two streams, one from the database, and one from the file that was the source of the image in the database. Then compare them byte by byte. If there is even one byte of diffrence, the database image data is corrupt.

提交回复
热议问题