Public Property [prod_Image]() As System.Drawing.Bitmap Get Try Return CType(Me.BinaryFormatter.Deserialize(New MemoryStream(CType(CurrentRow.Item("prod_Image"), Byte()))), System.Drawing.Bitmap) Catch Return Nothing End Try End Get Set(ByVal value As System.Drawing.Bitmap) Dim loStream As New MemoryStream() Me.BinaryFormatter.Serialize(loStream, value) Me.CurrentRow.Item("prod_Image") = loStream.ToArray() End Set End Property
So, paste that code over the prod_Image property and it should build properly.
All we are trying to show here is how a BO can serialize an image into a byte array and retrieve from the database without any coding on the side of the developer.
Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'System.Drawing.Image'. C:\Program Files\MicroFour\StrataFrame\VB.NET Samples\CRMApplication\SampleCRMApplication\Forms\OrderItemEntry.vb 37 33 SampleCRMApplication
This is the line:
What should I try? TIA.