I have a file stored in a SQL table as type Image (= ByteArray).
My DataPortal_Fetch looks like this:
Private Overloads Sub DataPortal_Fetch(ByVal crit As GetFileCriteria)
'call stored procedure
dr.Read()
FetchImage(dr)
dr.Close()
dr.Dispose()
End SubMy SafeDataReader procedure:
Private Sub FetchImage(ByVal dr As SafeDataReader) ' Value propertiesm_FileImage = dr.GetBytes(
"FileImage") End Subm_FileImage is declare as byte()
I can't get the SafeDataReader's GetBytes to work. Is it the right command to call to get an image data type from the database?
Thanks in advance.
I use code like this:
Protected mImagefile As Byte() = Nothing
Public Overridable Property Imagefile() As Byte()
Get
Return mImagefile
End Get
Set(ByVal Value As Byte())
mImagefile = Value
End Set
End Property
With dr
If .Read Then
mImagefile = CType(.Item("imagefile"), Byte())
End If
End With
Joe
Copyright (c) Marimer LLC