I have an image to insert form a URL path in SQL Server using URL "http:\\....." but it is not working.
Could you have any suggestions to help me ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jun 13, 2011, 9:48 PM EDT
First you need to read the image from that specified url
and than try this Inserting & retrieving images from SQL Server database using stored procedures
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jun 13, 2011, 9:52 PM EDT
Refer these articles:
Link1: Click Here
Link2: Click here
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Jun 13, 2011, 10:14 PM EDT
byte[]Data = ReadFile(txtPath.Text);
SqlConnection Con= new SqlConnection(" ");
string strqry = "insert into ImagesStore (OriginalPath,ImageData)values(@OriginalPath, @ImageData)";
SqlCommand cmd = new SqlCommand(strqry,con);
cmd .Parameters.Add(new SqlParameter("@OriginalPath",(object)txtPath.Text));
cmd.Parameters.Add(new SqlParameter("@ImageData", (object)Data));
Con.Open();
cmd.ExecuteNonQuery();
Con.Close();
Suthish NairRank #92 · 22.8K reputationPosted Jun 14, 2011, 3:25 AM EDT