protected void submitbtn_Click(object sender, EventArgs e) { byte[] image = null; if (FileUpload1.HasFile) { int length = FileUpload1.PostedFile.ContentLength; image = new byte[length]; HttpPostedFile img = FileUpload1.PostedFile; img.InputStream.Read(image, 0, length); } string query = "Insert into pro(product,prname,prdes,key,price,image) values ('"+selec+"','"+prnametxt.Text+"','"+prdestxt.Text+"','"+keytxt.Text+"','"+pricetxt.Text+"',@imgs)"; MySqlCommand cmd = new MySqlCommand(query, con); cmd.Parameters.AddWithValue("@imgs", image); cmd.ExecuteNonQuery(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)