How to fetch the image from database using linq , where image is stored in byte code in DataBase.
Here we are having a database model as dbtest, where pictures is the
Table name the Column name is img.
There is panel named ImgPanel where we are Getting the images
Table name the Column name is img.
There is panel named ImgPanel where we are Getting the images
dbtestEntities db = new dbtestEntities();
var images = from p in db.Pictures
select Image.FromStream(new MemoryStream(p.img.ToArray());
foreach (Image image in images)
{
ImgPanel.Controls.Add(image);
}
Comments
Post a Comment