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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Jun 14, 2011, 7:25 AM
Gomathi PalaniswamyPosted Jun 14, 2011, 2:14 AM
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();
Jiteendra SampathiraoPosted Jun 14, 2011, 1:52 AM
Refer these articles:
Link1: Click Here
Link2: Click here
Jaganathan BantheswaranPosted Jun 14, 2011, 1:48 AM
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