hi there i have an image i want to save it in access database i want to save the image not the path im using this
Dim tr As New ZieZoDB
Dim conn As OleDbConnection
conn = Me.OleDbConnection1
Dim fs As FileStream = New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.Read)
Dim s As String = Me.txtimagepath.Text
'Read the output in binary reader
Dim r As BinaryReader = New BinaryReader(fs)
'Declare a byte array to save the content of the file to be saved
Dim FileByteArray(fs.Length - 1) As Byte
r.Read(FileByteArray, 0, CInt(fs.Length))
and here is the problem in this query
Try
Dim dbclass As New ZieZoDB
Dim query As String
query = "INSERT INTO [StudentInfo] ([StudentID], [StudentImage], [StudentCardNumber] , [StudentName]) VALUES
('" & Me.txtstudentid.Text&"' ,,(???????????),'" & Me.txtcardnmber.Text & "', '" & Me.txtname.Text & "');"
dbclass.executeNonQuery(query)
what should i put for the image in the query to save thanks
Dim tr As New ZieZoDB
Dim conn As OleDbConnection
conn = Me.OleDbConnection1
Dim fs As FileStream = New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.Read)
Dim s As String = Me.txtimagepath.Text
'Read the output in binary reader
Dim r As BinaryReader = New BinaryReader(fs)
'Declare a byte array to save the content of the file to be saved
Dim FileByteArray(fs.Length - 1) As Byte
r.Read(FileByteArray, 0, CInt(fs.Length))
and here is the problem in this query
Try
Dim dbclass As New ZieZoDB
Dim query As String
query = "INSERT INTO [StudentInfo] ([StudentID], [StudentImage], [StudentCardNumber] , [StudentName]) VALUES
('" & Me.txtstudentid.Text&"' ,,(???????????),'" & Me.txtcardnmber.Text & "', '" & Me.txtname.Text & "');"
dbclass.executeNonQuery(query)
what should i put for the image in the query to save thanks