title: How to insert image into database from Visual Studio
body: <p>I have a database table PHOTOS created in Visual studio. It has id (int), filename (string) and photo filed type image. I made a form to insert current immage from PictureBox into database. Of course, since I am very inexperienced it does not work.
  How do you insert image into database from picturebox in c#? Thank you for answer, I know this code is wrong but I hope it gives you an idea what am I trying to do.</p>
  
  <pre><code>SqlCeCommand command = new SqlCeCommand("insert  into photos(id, photo ,filename) values (@id, @blob,@filename)", connection);
  command.Parameters.AddWithValue("@blob", pictureBox1.Image);//fileBytes);
  command.Parameters.AddWithValue("@filename", textBox1.Text);
  command.Parameters.AddWithValue("@id", Int32.Parse(textBox2.Text));
  </code></pre>