Display Images in DataList Control using the path stored in SQL Server database

I try to Display Images in DataList Control using the path stored in SQL Server database.
The images stored in the separate folder called "Images" on web server & I store the image path in the Database

I use sqldatasource to show the data:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:BLSDBConnectionString1 %>"
            SelectCommand="SELECT * FROM [Employees] ORDER BY [LastName]">
        </asp:SqlDataSource>
I can show images in the gridview but on the web page we need to show three images in the row. So I need to use datalist and not the gridview.
 This is my code:
<asp:DataList ID="dtList"
            runat="server"  
            DataSourceID="SqlDataSource1"
            HorizontalAlign="Justify"
            RepeatColumns="3"
            RepeatDirection="Horizontal" >
           
            <ItemTemplate>
                EmployeeId:
                <asp:Label ID="EmployeeIdLabel"
                    runat="server"
                    Text= '<%#DataBinder.Eval(Container.DataItem, "EmployeeId")%>'></asp:Label>
                <br />
                FirstName:
                <asp:Label ID="FirstNameLabel"
                    runat="server"
                    Text='<%#DataBinder.Eval(Container.DataItem,"FirstName") %>' />
                <br />
                MidInit:
                <asp:Label ID="MidInitLabel"
                    runat="server"
                    Text='<%#DataBinder.Eval(Container.DataItem,"MidInit") %>' />
                <br />
                LastName:
                <asp:Label ID="LastNameLabel"
                    runat="server"
                    Text='<%#DataBinder.Eval(Container.DataItem,"LastName") %>' />
                <br />
                Unit:
                <asp:Label ID="UnitLabel"
                    runat="server"
                    Text='<%#DataBinder.Eval(Container.DataItem,"Unit") %>' />
                <br />
                PictureFileName:
                <asp:Label ID="PictureFileNameLabel" runat="server"
                    Text='<%#DataBinder.Eval(Container.DataItem,"PictureFileName") %>' />
                <br />
                <asp:Image ID="ImageID" runat="server" Width="100px"
                   
                    ImageUrl='<%# Eval("ImagePath") %>' />                
      </ItemTemplate>          
        </asp:DataList>
All records show except the image. It is empty.
How can I correct it?
Please, help.
msoutAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
Can you verify the value of ImagePath?  Maybe have the value show in the list temporarily, for testing purposes...

It maybe the path is invalid or corrupt somehow.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
msoutAuthor Commented:
Thank you, I found out that the ImagePath in db was not written right. Now I have to resolve one more problem.
 images/Aaron Bitler.jpg - this is the ImagePath. I cannot delete the extension - .jpg because it won't show the picture. How can I show only the picture without the   "images/Aaron Bitler.jpg "
0
msoutAuthor Commented:
Never mind! I just deleted hiperlink and it shows only a picture!
0
Paul MacDonaldDirector, Information SystemsCommented:
Great!  Happy to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.