hi,
I have a column named Image in my database.i am able to load all the fields in the database including image also,but I am getting only one image in all the rows and that image is related to the mentioned ID in the query.
my code is:
I have a column named Image in my database.i am able to load all the fields in the database including image also,but I am getting only one image in all the rows and that image is related to the mentioned ID in the query.
my code is:
public ActionResult GetImage()
{
var imgquery = (from img in dbContext.Personaldetails where img.ID == 1
select new
{
Image = img.Image
}).FirstOrDefault();
{
System.IO.MemoryStream outStream = new System.IO.MemoryStream();
byte[] Image = imgquery.Image;
return File(Image, "Image/jpg");
}
}
In the view,i retrieved by using <img src="@Url.Action("GetImage", "Home")" alt = "image" />
now, i want to display specific images with specific ID value.