title: How to Insert Image to Access Database OLEobject Field
body: <p>I am trying to insert an image into OLEobject field by executing the following blocks of code.</p>
  
  <pre><code>    Private Sub BtnRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRegister.Click
          con.Open()
          Dim cmd As OleDbCommand = New OleDbCommand("INSERT INTO `Std_Registeration` (`CNIC`, `Std_Name`, `Father_Name`, `Reg_number`, `Gender`, `Department`, `Semester`,`Std_Picture`, `Email`, `Password`) VALUES ('" &amp; CNICTextBox.Text &amp; "','" &amp; Std_NameTextBox.Text &amp; "','" &amp; Father_NameTextBox.Text &amp; "','" &amp; Reg_numberTextBox.Text &amp; "','" &amp; GenderComboBox.Text &amp; "','" &amp; DepartmentTextBox.Text &amp; "','" &amp; SemesterTextBox.Text &amp; "','" &amp; Std_PicturePictureBox.ImageLocation &amp; "','" &amp; EmailTextBox.Text &amp; "','" &amp; PasswordTextBox.Text &amp; "')", con)
          Dim i As Integer = cmd.ExecuteNonQuery()
          If (i &gt; 0) Then
              MessageBox.Show("Registeration Successful!")
          Else
              MessageBox.Show("OOPS! Something went wrong. Try Again!")
          End If
          con.Close()
      End Sub
  </code></pre>
  
  <p>I know sending ImageLocation to OLEobject doesn't make any sense. It needs to be converted into Binary or something like that. I want to insert image into database field (OlEobject) properly.</p>