Ramesh G

Ramesh G

  • 1.7k
  • 201
  • 60.5k

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: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (2)