Retrieving image filename from database and displaying image on page
Posted on 2008-10-01
I am developing an ASP.NET web page with VB.NET. I have the filenames for images stored in a column of my SQL Server database. I am querying the data for a specific product SKU. The result of the query will bring a file name, such as 08326A.jpg. I need the proper syntax for the VB.NET to retrieve that filename and then display that image from its location in a folder on the web server. I've tried looking online and all I came up with was something like:
<asp:Image ID="imgMed" BorderWidth="0" runat="server" ImageUrl="/images/medium/" + <%# DataBinder.Eval(Container.DataItem, "med_img") %> />
but that only causes errors.