I need to retrieve the data information from a database and bind the image to an image control not a datagrid or gridview or datalist.
here the code i m using it not working
con.Open()
Dim mycommand As New SqlCommand("SELECT * FROM registration where UserName = @ username", con)
mycommand.Parameters.AddWithValue("@UserName", Session("UserName").ToString())
imgUser.ImageUrl = "UserPics/(image1);
con.close()
and
<asp:Image ID="imgUser" runat="server" Width="340px" Height="150px" ImageUrl="UserPics/<%# Databinder.Eval(container.DataItem, "imagel") %>.jpg"/>
@ usernameshould not have a space =>–
"SELECT * FROM registration where UserName = @username",;should be a"=>–
imgUser.ImageUrl = "UserPics/(image1)"Though I’m not sure what that line actually achieves…