Hi there! I am new to ASP.Net I am not able to display images in the Data Repeater control. It does display text but not the images. I have created a Folder named Images in the root directory and has all the images there. And the path of these images are in the database table named Employee and column name PicturePath. But the images still doesn't show, only the data(i.e the text).

The line of code that I've used for displaying pictures is:
<asp:Image height=100 width=100 Img scr='<%# Container.DataItem("PicturePath")%>' runat="server" ID = "Images"/>

Here, PicturePath is the column where the Path of the picture is stored.

The complete code is shown below:

VB Code:
  1. <%@ Import Namespace="System.Data.OleDb" %>
  2. <%@ Import Namespace="System.Data" %>
  3. <HTML>
  4.     <HEAD>
  5.         <!— Chapter3/Repeater1.aspx —>
  6.         <script language="VB" runat="server" Debug="true">
  7. Sub Page_Load(src As Object, e As EventArgs)
  8.     If Not IsPostBack
  9.         bindListControl
  10.     End If
  11. End Sub
  12.  
  13. Sub bindListControl()
  14.     Dim myConn As OleDbConnection
  15.     Dim myOleDbAdapter As OleDbDataAdapter
  16.     Dim connStr, sqlStr As String
  17.     Dim myDataSet As New Dataset
  18.     connStr="Provider=Microsoft.Jet.OLEDB.4.0;" _
  19.     + "Data Source=C:\Inetpub\wwwroot\WebApplication1\test.mdb"
  20.     sqlStr = "SELECT EmpID, Name, Tel, Address, PicturePath FROM Employee"
  21.     myConn= New OleDbConnection(connStr)
  22.     myConn.Open()
  23.     myOleDbAdapter =New OleDbDataAdapter(sqlStr,myConn)
  24.     myOleDbAdapter.Fill(myDataSet,"dtProducts")
  25.     repeater1.DataSource=myDataSet.Tables("dtProducts")
  26.     repeater1.DataBind()
  27. End Sub
  28.         </script>
  29.     </HEAD>
  30.     <body>
  31.         <h2>Data Repeater Control</h2>
  32.         <asp:repeater id="repeater1" runat="server">
  33.             <ItemTemplate>
  34.                 <table>
  35.                     <tr>
  36.                         <td>
  37.                             <asp:Image height=100 width=100 Img scr='<%# Container.DataItem("PicturePath")%>' runat="server" ID = "Images"/>
  38.                            
  39.                            
  40.                         </td>
  41.                     </tr>
  42.                     <td>
  43.                         Emp ID: <i><b>
  44.                                 <%# Container.DataItem("EmpID")%>
  45.                             </b></i>
  46.                         <br>
  47.                         Name: <i><b>
  48.                                 <%# Container.DataItem("Name")%>
  49.                             </b></i>
  50.                         <br>
  51.                         Phone: <i><b>
  52.                                 <%# Container.DataItem("Tel")%>
  53.                             </b></i></b>
  54.                         <br>
  55.                         Address: <i><b>
  56.                                 <%# Container.DataItem("Address")%>
  57.                             </b></i></b>
  58.                         <br>
  59.                         <br>
  60.                         <br>
  61.                     </td>
  62.                 </tr>
  63.             </ItemTemplate>
  64.             <HeaderTemplate>
  65.                 </table>
  66.             </HeaderTemplate>
  67.             <FooterTemplate>
  68.                 </table>
  69.             </FooterTemplate>
  70.         </asp:repeater>
  71.     </body>
  72. </HTML>