SqlConnection con = new SqlConnection("Server=.;database=CollectionDb;integrated security=true"); SqlCommand com = new SqlCommand("insert into tblMusic(fldCode,fldPic) values(1,@Pic)", con); MemoryStream stream=new MemoryStream(); frontPictureBox.Image.Save(stream,System.Drawing.Imaging.ImageFormat.Jpeg); byte[] pic=stream.ToArray(); com.Parameters.AddWithValue("@Pic", pic); try { con.Open(); com.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { con.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)