D
Dav
Hi all,
I am using these code to save Image to database:
Dim fs As FileStream = New FileStream(filename, _
FileMode.OpenOrCreate, FileAccess.Read)
Dim rawData() As Byte = New Byte(fs.Length) {}
fs.Read(rawData, 0, System.Convert.ToInt32
(fs.Length))
fs.Close()
OleDbDataAdapter1.InsertCommand.CommandText = _
"Insert Into ImageTest Values (" & rawData & ")"
OleDbDataAdapter1.InsertCommand.ExecuteNonQuery()
MsgBox("Image saved to database")
But there is a problem in :
"Insert Into ImageTest Values (" & rawData & ")"
The error message is
Operator '&' is not defined for types 'String' and '1-
dimensional array of Byte'.
Anyone can help
Thanks
I am using these code to save Image to database:
Dim fs As FileStream = New FileStream(filename, _
FileMode.OpenOrCreate, FileAccess.Read)
Dim rawData() As Byte = New Byte(fs.Length) {}
fs.Read(rawData, 0, System.Convert.ToInt32
(fs.Length))
fs.Close()
OleDbDataAdapter1.InsertCommand.CommandText = _
"Insert Into ImageTest Values (" & rawData & ")"
OleDbDataAdapter1.InsertCommand.ExecuteNonQuery()
MsgBox("Image saved to database")
But there is a problem in :
"Insert Into ImageTest Values (" & rawData & ")"
The error message is
Operator '&' is not defined for types 'String' and '1-
dimensional array of Byte'.
Anyone can help
Thanks