title: A Generic Error occurred in GDI+ Saving Picturebox into ole database
body: <p>I'm trying to save a picturebox into an ole database.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>Dim stream As New IO.MemoryStream
  PictureBox1.Image.Save(stream, Imaging.ImageFormat.Jpeg)
  Try
      Dim query As String = "INSERT INTO Guestinfo ([GuestName],[Phone],[Idofguest],[Room],[Arrival],[Checkout],[Address],[IDImage]) VALUES ('" &amp; TextBox1.Text &amp; "','" &amp; TextBox2.Text &amp; "','" &amp; TextBox3.Text &amp; "','" &amp; TextBox5.Text &amp; "','" &amp; DateTimePicker1.Text &amp; "','" &amp; DateTimePicker2.Text &amp; "','" &amp; TextBox4.Text &amp; "',(@IDImage))"
      Dim command As New OleDbCommand
  
      With command
          .CommandText = query
          .Parameters.AddWithValue("@Picture", stream.GetBuffer())
          .Connection = conn
          .ExecuteNonQuery()
      End With
      MsgBox("Saved Successfully!", MsgBoxStyle.Information)
      conn.Close()
  Catch ex As Exception
      MsgBox(ex.Message)
  End Try
  </code></pre>
  
  <p>In "A Generic Error occurred in GDI+" this error appear:</p>
  
  <pre><code>PictureBox1.Image.Save(stream, Imaging.ImageFormat.Jpeg)
  </code></pre>
  
  <p>By the way, my column type is Ole Object.
  I hope someone help me ... </p>