how to display images from database on datalist in asp.net 2.0

60 pts.
Tags:
ASP.NET 2.0
ASP.NET Web applications
Dear all, Please help me ,how to display images from database on datalist  in asp.net.my coding are mention below,all my records are display but images are not display. HTML CODE:- <asp:DataList ID="DataList1" runat="server" BackColor="White" BorderColor="#336666"             BorderStyle="None" BorderWidth="0px" CellPadding="15" GridLines="Both" CssClass="normal-txt" HorizontalAlign="Center" RepeatColumns="2" RepeatDirection="Horizontal" ShowFooter="False" ShowHeader="False" Width="60%" >             <FooterStyle BackColor="White" ForeColor="#333333" />             <ItemStyle BackColor="White" ForeColor="#333333" />             <SelectedItemStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />             <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />             <ItemTemplate>                  <table style="width: 227px" visible=true>                     <tr>                         <td align="center" colspan="3" rowspan="3" valign="middle">                             <asp:Image ID="Image1" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImagePath") %>'   Height="154px" Width="128px" > </asp:Image > </td>                     </tr>                     <tr>                     </tr>                     <tr>                     </tr>                 </table>                 <br />                                                         <br />                                  </ItemTemplate>         </asp:DataList> CS CODING using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using System.Configuration; using System.Web.Mail; public partial class datalist : System.Web.UI.Page {        protected void Page_Load(object sender, EventArgs e)     {         if (!Page.IsPostBack)         {             try             {                 SqlConnection con = new SqlConnection("server=SERV2005;uid=sa;pwd=sa12345;database=PERDB");                 con.Open();                 DataSet ds1 = new DataSet();                 SqlDataAdapter ad = new SqlDataAdapter("select * from Productdetails where categoryname='homePageProducts'", con);                 ad.Fill(ds1);                 DataList1.DataSource = ds1;                 DataList1.DataBind();                       }            catch (Exception ex)             {                 Response.Write(ex);             }          }      }     }
ASKED: November 12, 2009  9:14 AM
UPDATED: December 27, 2013  10:06 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Add your answer…

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following