Click here to Skip to main content
14,971,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
my code is:
C#
public ActionResult GetImage(int ID)
       {
           var imgquery = (from img in dbContext.Personaldetails where img.ID == ID

                           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
HTML
<img src="@Url.Action("GetImage/1", "Home")"  alt = "image" /> 

now, i want to display specific images with specific ID value.
Posted
Updated 5-Jun-12 0:57am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900