Hi
Can't Display Profile Image using asp .net
<asp:Image ID="Image1" runat="server" />
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!Page.IsPostBack)
{
lb1.Text = "<b><font color=Brown>" + "Hi.." + "</font>" + "<b><font color=red>" + Session["UserName"] + "</font>";
bind();
}
}
catch (Exception ex)
{
Response.Write("<script>alert('" + ex.Message.ToString() + "');</script>");
}
}
private void bind()
{
SqlConnection con = new SqlConnection(strConnString);
SqlCommand cmd = new SqlCommand("select image from Login where UserName='" + Session["UserName"] + "'", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Image1.ImageUrl = dr[0].ToString();
}
con.Close();
}
Any Idea ..