Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to retrieve image from SQL Server(Database) and set it to Picture Box Image Property .

if (FileUpload1.HasFile)
{
String str=Fileupload1.FileName;
Fileupload1.PostedFile.SaveAs(Server.MapPath(".")+"//Image//"+str);
String path="//Image//"+str.ToString();
Sc.Open();
SqlCommand cmd=new SqlCommand("Insert into Image values('"+Txtname.Text+"','"+path+"')",Sc);
Cmd.ExecuteNonquery();
Sc.Close();
Label1.Text="inserted";
}
else
{
Label1.Text="Not inserted";
}

how to retrieve image from database to picturebox
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900