I am trying to show image on the label retrieved from the database. My front end code is
<asp:Image ID="Image1" runat="server" Height="150px" Width="120px" />
where as my backend code is:
string query = "select quantity, name, price, description, type, Catagory, FilePath from product where p_id ='" + IdList.SelectedValue + "' ";
con.Open();
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader rdr = cmd.ExecuteReader();
if(rdr.HasRows)
{
while (rdr.Read())
{ string filename1 = rdr.GetString(6);
Image1.ImageUrl="C:\\Users\\Fatima\\Downloads\\db-final-project\\db final project\\db final project\\UploadedImages\\"+filename1; }
kindly help me in displaying my image in label in the web form