i have a image in the form in asp.net
i have a button
i have dragged some labels controls and placed on that image if i click the button i want to save it to sql. Any idea regarding this
Loading
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.
senthilPosted Jan 7, 2010, 7:16 AM
senthilPosted Jan 7, 2010, 7:14 AM
i drag and drop labels on that image ... atlast the image with drag and dropped labels stored in database
paul danielPosted Jan 7, 2010, 6:48 AM
First u create ImgId,Img,Imglength in ur database and create a byte[] for saving the image in ur db
int imagelen = Upload.PostedFile.ContentLength;
byte[] picbyte = new byte[imagelen];
Upload.PostedFile.InputStream.Read (picbyte, 0, imagelen);
conn.Open ();
SqlCommand cmd = new SqlCommand ("insert into Imgtble"
+ "(ImageField, ImageID) values (@Img, @imageid)", conn);
cmd.Parameters.Add ("@Img", picbyte);
cmd.Parameters.Add ("@imageid", lblImageID.Text);
cmd.ExecuteNonQuery ();
Thanks,
Paul daniel
Rekha SinghPosted Jan 7, 2010, 5:49 AM