Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'TODO: This line of code loads data into the 'StudDataSet.student' table. You can move, or remove it, as needed.
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Extern Innovation\Desktop\stud.mdb")
adapter = New OleDbDataAdapter("select * from student", con)
ds = New DataSet()
adapter.Fill(ds, "student")
ds.Tables(0).Constraints.Add("pk_sno", ds.Tables(0).Columns(0), True)

TextBox1.Text = ds.Tables(0).Rows(rno)(0).ToString()
TextBox2.Text = ds.Tables(0).Rows(rno)(1).ToString()
TextBox3.Text = ds.Tables(0).Rows(rno)(2).ToString()

'PictureBox1.Image = Nothing
' If (ds.Tables(0).Rows(rno)(3)!System.DBNull.Value) Then

'photo_array = ds.Tables(0).Rows(rno)(3).ToString
' ms = New MemoryStream(photo_array)
'PictureBox1.Image = Image.FromStream(ms)

' End If


End Sub

Private Sub browseButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles browseButton.Click
Dim res As DialogResult
OpenFileDialog1.Filter = "jpeg|*.jpg|bmp|*.bmp|all files|*.*"
res = OpenFileDialog1.ShowDialog()
If (res = DialogResult.OK) Then
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub

Private Sub insertButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles insertButton.Click
Dim sno As Integer
Dim sname, course As String
Dim photo As Image
'Dim query As Integer
sno = TextBox1.Text
sname = TextBox3.Text
course = TextBox3.Text
photo = PictureBox1.Image
Dim ms As New MemoryStream
'Dim stream As FileStream
photo.Save(ms, ImageFormat.Jpeg)
Dim data = ms.ToArray()

'con = New OleDbConnection("insert into student(sno,sname,course,photo) values(" + TextBox1.Text + ",'" + TextBox2.Text + "','" + TextBox3.Text + "',@photo)", con)
Dim str As String = "insert into student values(" & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "','" & PictureBox1.ToString & "'"
Dim mycommand As New OleDbCommand
mycommand.Parameters.Add("@sno", OleDbType.VarChar)
mycommand.Parameters.Add("@sname", OleDbType.VarChar)
mycommand.Parameters.Add("@course", OleDbType.VarChar)
' mycommand.Parameters.Add("@photo", OleDbType.VarChar)
mycommand.Parameters("@sno").Value = sno
mycommand.Parameters("@sname").Value = sname
mycommand.Parameters("@course").Value = course
' mycommand.Parameters("@photo").Value = photo
mycommand.CommandText = Text
mycommand.Connection = con
cmd = New OleDbCommand(str, con)
cmd.Parameters.AddWithValue("@photo", photo)

Dim n As Integer
If (n > 0) Then

MessageBox.Show("record inserted")
' PictureBox1.Image = My.Resources.Culture.Equals

MessageBox.Show("insertion failed")
End If
'Dim conv_photo As Convert
'If (PictureBox1.Image!DBNull.Value) Then

' Dim ms As MemoryStream = New MemoryStream()
' PictureBox1.Image.Save(ms, ImageFormat.Bmp)
' Dim photo_aray As Byte
'photo_aray = ms.Read(photo_aray, 0, 0)
'ms.Position = 0
' ms.Read(photo_aray, 0, 0)

' Dim data As IDataObject
' Dim bmap As Image
' Dim ms As New IO.MemoryStream()
'PictureBox1.Image.Save(ms, ImageFormat.Bmp)
'data = Clipboard.GetDataObject()
'If data Is Nothing Then Exit Sub
'If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
'photo = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image)
' photo.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)
' Image = ms.GetBuffer
'cmd.Parameters.AddWithValue("@photo", photo)
'End If
End Sub
this codeing is save and load image in ms access but is not working so please correct this code .mdb file name stud tabale name is student fildname is photo fild type is olb object