Here is my code
Dim Cmd As New OleDbCommand
Dim strsql As String
Try
Dim fsreader As New FileStream(OpenFile.FileName, FileMode.Open, FileAccess.Read)
Dim breader As New BinaryReader(fsreader)
Dim imgbuffer(fsreader.Length) As Byte
breader.Read(imgbuffer, 0, fsreader.Length)
fsreader.Close()
strsql = "UPDATE AccResult SET (PicFile, PicName) Values (@pfile, @pname) WHERE StudNo = '" & Form1.sNo.Text & "'"
Cmd = New OleDbCommand(strsql, con)
Cmd.Parameters.AddWithValue("@pfile", txtSave.Text)
Cmd.Parameters.AddWithValue("@pname", imgbuffer)
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Catch ex As Exception
End Try
please help me how can i update the students data when saving their picture in database. im using VB.NET. Thank You.