title: how to insert image in mysql database using vb.net and adodb connection
body: <p>I want to insert an image into a mysql database using the adodb connection in vb.net 2008.</p>
  
  <p>I am using a select query to insert data into database, here is my code for adding or saving data...</p>
  
  <pre><code>    rs.Open("select * from registration where Debt_ID = '" &amp; txtDebt_ID.Text &amp; "' ", cnn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockPessimistic)
      If rs.RecordCount = 1 Then
          MsgBox("ID already exist!", MsgBoxStyle.Exclamation, vbOK)
          rs.Close()
          cnn.Close() 
  
          Exit Sub
      Else
  
          rs.AddNew()
          rs.Fields("Debt_ID").Value = txtDebt_ID.Text
          rs.Fields("LastName").Value = txt_Lastname.Text
          rs.Fields("firstName").Value = txt_Firstname.Text
          rs.Fields("MiddleName").Value = txt_Middlename.Text
          rs.Fields("age").Value = txt_Age.Text
          rs.Fields("birthdate").Value = txt_Birthdate.Text
          rs.Fields("civil_status").Value = txtCivil_status.Text
          rs.Fields("address").Value = txt_Address.Text
          rs.Fields("occupation").Value = txt_Address.Text
          rs.Fields("contact_no").Value = txt_Contact.Text
          'rs.Fields("picture").Value = PictureBox1.Image
          rs.Save()
          rs.Close()
      End If
  </code></pre>
  
  <p>I wanted to add an image on the database into the field picture and I'm using blob as my datatype for it, I also want to retrieve the image from the database and display it in a picturebox... can someone please help regarding my problem.</p>
  
  <p>Thanks in advance...</p>