skip to Main Content

I am working on a resume generator project. It requires the user to fill out a form consisting of many personal information like name, email, personal photo, and so on.
The info is stored in the database and has to be retrieved to generate the resume. However, I stored the user’s photo as shown below: (Note: image is stored as varchar “only the path and the name”)

FileUpload1.SaveAs(Server.MapPath("Image/" +filename));
cmd.Parameters.AddWithValue("@ImagePath", "Image/" + filename);

How can an image be displayed on a web form page retrieved from the database?

Software: Visual Studio 2019 – Community version
Languages: HTML5, CSS3 ASP.NET, and C# for the behind code.

I did not do anything. I am a nope in programming and I felt helpless.

2

Answers


  1. Maybe you can use a repeater to show your stored images.

    Show images in Repeater control

    For this you can use a SqlDataSource or DataTable in the code behind.

    Login or Signup to reply.
  2. Since you already know the path of the image file, do the following:

    <asp:Image ID="imgDisplay" runat="server" ImageUrl="~/Image/your_image.jpg" />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search