I have only been playing with asp.net and linq for about a year and am trying to create a picture portfolio.
I found an example on the web, but am having a problem understanding the function provided.
In the sample app, they receive no error, but in my environment, I recieve an error
value of type system.data.linq.binary cannot be converted to 1 - dimensional array of byte.
The fields in the db are of type image.
Would someone please explain to me what this is doing and why I am getting the error when it table is set up like it.
Private Shared Function GetPhotoBytes(ByVal source As IQueryable(Of Portfolio), ByVal size As PhotoSize) As Stream
Dim imageBytes As Byte()
Select Case size
imageBytes = source.Select(Function(p) p.BeforePicBytesFull).SingleOrDefault
imageBytes = source.Select(Function(p) p.BytesOriginal).SingleOrDefault
imageBytes = source.Select(Function(p) p.BytesThumb).SingleOrDefault
imageBytes = source.Select(Function(p) p.BytesPoster).SingleOrDefault
If imageBytes IsNot Nothing Then
Return New MemoryStream(imageBytes)
Return New MemoryStream()