-1

I want to retrieve data from database but i'm not able to retrieve image.I've taken TmagePath Datatype as nvarchar

enter image description here PFB

enter image description here

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44

1 Answers1

0

First you must consider that the datatype in your Database of image must be VarBinary. Than try this:

var filename = ds.Tables[0].Rows[0];
byte[] getImg = new byte[0];
getImg = (byte[])filename["WImagepath"];
MemoryStream stream = new MemoryStream(getImg);
Picwaiter.Image = Image.FromStream(stream);

Maybe usefull answer: https://stackoverflow.com/a/29589703/5603115

nemostyle
  • 794
  • 4
  • 11
  • 32