Problem, which I can see
1. In the below line, you are giving the
ImageUrl
as the "
ImageID" from the
BindingSource
.
<asp:Image ID="Image1" runat="server" ImageUrl ='<%#"ImageHandler.ashx?ImID="+Eval("ImageID") %>' height="150px" Width="150px"/>
But while binding you are reading "
imageID".
SqlCommand command = new SqlCommand("select imagename, imageID from[Image]",connection);
The names are different. So, I suspect the IDs are not getting added to the
ImageUrl
correctly.
But you need to debug and see whether the ID is getting added to the rows and the same ID is going to the Handler or not.
2. There is a space needed after "
from" and before "
[Image]" in the below query.
SqlCommand command = new SqlCommand("select imagename, imageID from [Image]",connection);