I am currently using Visual Studio 2008 (VB.Net) and SQL Server 2008. I have images saved on the database as image. When I fetch it into my code it is a System.Byte[] and I am unable to cast it as a System.Drawing.Image to save to my DevExpress(v10.2).XtraEditors.ImageEdit.
I have tried to
Dim imgStream As MemoryStream = New MemoryStream(image, 0, image.Length)
or
Dim imgStream As MemoryStream = New MemoryStream(image)
Yet even then I am unable to call image.FromStream(imgStream) or bitmap.FromStream(imgStream) as I get a "Parameter is not valid" when I try.
EDIT:
We are updating from a previous system that was on SQL 2000. When I run the previous program I can see the image in the program. When I run the new one any image that I migrated is an 'invalid parameter' yet any image I added to the database (through the input on the program) is viewable. When I fetch the image from the old database and the new one they are the exact same. Is there a difference between SQL 2000 and SQL 2008 that I should take into account when migrating the data?
imagehas nothing to do with images, it just can hold any binary data.