M
moondaddy
I'm caching a dataset in an asp.net session variable to hold a user's data.
one data item I need to store is an image the user uploaded. My problem is
that I don't know how to get the image into the dataset because I don't know
what datatype to set the dataset column and then set this image to. I saw
an example where someone defended a datatable in the global class and
defined the column as an object, however, when I define a strongly typed
dataset in the IDE there's no data type called object, binary, or byte().
For a start, here's how I'm getting the image data from the user
(ImageFileField is an inupt element type 'File' in the aspx):
Dim strm As Stream
strm = ImageFileField.PostedFile.InputStream
Dim lngLen As Long = strm.Length
Dim abytBuffer(CInt(lngLen - 1)) As Byte
strm.Read(abytBuffer, 0, CInt(lngLen))
So from here I have a memorystream object and a byte array both with the
image data. So now what do I do?
Thanks.
one data item I need to store is an image the user uploaded. My problem is
that I don't know how to get the image into the dataset because I don't know
what datatype to set the dataset column and then set this image to. I saw
an example where someone defended a datatable in the global class and
defined the column as an object, however, when I define a strongly typed
dataset in the IDE there's no data type called object, binary, or byte().
For a start, here's how I'm getting the image data from the user
(ImageFileField is an inupt element type 'File' in the aspx):
Dim strm As Stream
strm = ImageFileField.PostedFile.InputStream
Dim lngLen As Long = strm.Length
Dim abytBuffer(CInt(lngLen - 1)) As Byte
strm.Read(abytBuffer, 0, CInt(lngLen))
So from here I have a memorystream object and a byte array both with the
image data. So now what do I do?
Thanks.