Error“ Parameter is not valid ” while converting Bytes into Image

前端 未结 6 904
心在旅途
心在旅途 2020-11-30 12:19

I am converting bytes into an image but I get an error

Parameter is not valid

I am pasting my code. Kindly check the code and

6条回答
  •  甜味超标
    2020-11-30 13:02

    The problem is because, you are bringing it incorrectly from database. Try changing your code like this:

    while (registry.Read())
    {
       byte[] image = (byte[])registry["Image"];
    }
    

提交回复
热议问题