Ramesh G

Ramesh G

  • 1.8k
  • 205
  • 60.8k

Image not show in picture box

Oct 17 2019 12:42 AM
i have get store the image in varbinay format in sql datatbase. i get the record in data table. record show in datatable,bt show time error occured.how can i fix the error
Error: .'fromstream parameter is not valid" 
if (dt.Rows.Count > 0)
   Byte[] MyData = new byte[0];
   MyData = ((Byte[])dt.Rows[0]["Company_Logo"]);
      if (MyData != null)
            MemoryStream stream = new MemoryStream(MyData);
            pbox_logo.Image = Image.FromStream(stream);

Brought to you by:

Answers (2)