Posted on: 10/8/2012 12:52:06 AM | Views : 269

Hello, I am having trouble storing image in my varbinary column, it seems to only store the text contents instead and doesnt take also the binary data of the image. This is my code:
protected void Button2_Click(object sender, EventArgs e) { String Back = "upload.aspx"; if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "") { byte[] imageSize = new byte [FileUpload1.PostedFile.ContentLength]; HttpPostedFile uploadedImage = FileUpload1.PostedFile; uploadedImage.InputStream.Read (imageSize, 0, (int)FileUpload1.PostedFile.ContentLength); SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["Sql"].ConnectionString; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Insert Into table_1 (Title ...

Go to the complete details ...