How to store picture into database and retrieval
-
Please help me. I want employee photo store into SQL database. And retriev the photo from database and display a photo in IE. Please give me exact coding in VB. Thanking You, abglorie
i have a code in C# for access database make an upload folder in your project file Label1.Text = Server.MapPath(@"~/Upload/" + FileUpload1.FileName.ToString()); FileUpload1.SaveAs(lbl_path.Text); Image1.ImageUrl = "~/Upload/" + FileUpload1.FileName; Label1.Text = FileUpload1.FileName; and now through insert command save Label1.Text into your database and for retrieving the picture and for retrieving the picture use select command give id of that row in some textbox cmd=new oledbcommand("Select Image from Images where ID='"+textbox1.text+"'",con); rd=cmd.executereader(); if(rd.read()) { textbox2.text=rd["Image"].tostring(); Image1.ImageUrl=@"~\upload\"+textbox2.text; } hope it works