private void button2_Click(object sender, EventArgs e) { byte[] bt = null; FileStream fs = new FileStream(pictureBox1.ImageLocation, FileMode.Open, FileAccess.Read);// this is for first image selected in picbox1 FileStream fs2 = new FileStream(pictureBox2.ImageLocation, FileMode.Open, FileAccess.Read);// here i repeated the upper line BinaryReader bnr = new BinaryReader(fs); BinaryReader bnr1 = new BinaryReader(fs2);//here bt = bnr1.ReadBytes((int)fs2.Length);// again bt = bnr.ReadBytes((int)fs.Length); SqlCommand cmd = new SqlCommand("insert into tbldesgin(dsname,fside,bcside)values(@dsname,@fside,@bcside)", cn); cmd.Parameters.Add(new SqlParameter("@fside", bt)); cmd.Parameters.Add(new SqlParameter("@bcside", bt)); cmd.Parameters.AddWithValue("@dsname", textBox1.Text); cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); MessageBox.Show("data has been sent"); pictureBox1.Image = null; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)