title: How to update/store Image from picturebox to database (MS Access2007)
body: <p>can anyone help me how to update/edit some image in picturebox to database ms access 2007?</p>
  
  <p>im using this code : </p>
  
  <pre><code>Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  
          Dim myCommand As New OleDbCommand
          Dim SQL As String
          Dim ms As New System.IO.MemoryStream
          Dim bmpImage As New Bitmap(PictureBox1.Image)
  
          Try
              If Not con.State = ConnectionState.Open Then Open_Koneksi()
  
              SQL = "UPDATE tb_pegawai SET nama=@nama, tgl_lahir=@tgl_lahir, gender=@gender, jabatan=@jabatan, alamat=@alamat, telepon=@telepon, foto=@image  WHERE nik=@nik"
              myCommand.Parameters.AddWithValue("@nik", TextBox1.Text)
              myCommand.Parameters.AddWithValue("@nama", TextBox2.Text)
              myCommand.Parameters.AddWithValue("@tgl_lahir", DateTimePicker1.Text)
              myCommand.Parameters.AddWithValue("@gender", jk.Text)
              myCommand.Parameters.AddWithValue("@jabatan", ComboBox1.Text)
              myCommand.Parameters.AddWithValue("@alamat", TextBox4.Text)
              myCommand.Parameters.AddWithValue("@telepon", TextBox5.Text)
  
              bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
              bytImage = ms.ToArray()
              ms.Close()
  
              myCommand.Parameters.AddWithValue("@image", bytImage)
  
              MsgBox("Data saved")
  
              myCommand.Connection = con
              myCommand.CommandText = SQL
              myCommand.ExecuteNonQuery()
  
              Data_Load()
              con.Close()
  
          Catch myerror As OleDbException
              MessageBox.Show("Error: " &amp; myerror.Message)
              Button1.Enabled = False
          Finally
              con.Dispose()
  
  
          End Try
      End Sub
  </code></pre>
  
  <p>when I run the program, did not get an error or anything.
  but the picture does not appear on ms access</p>