Image from table to imagebox in form not working

davearia

Centurion
Joined
Jan 4, 2005
Messages
184
Hi all,

I wrote a desktop application recently. The database was SQL Server, basically I had o form that was populated by the results of my dataset. I was a jigsaw daatabase and the form would show the name of the jigsaw, how many pieces, who painted it etc. Also I had a picturebox that displayed a picture of the jigsaw which retrieved from database via this code:
Code:
Dim arrPicture() As Byte = CType(ds.Tables(0).Rows(lnRowNumber)("Picture"), Byte())
Dim ms As New MemoryStream(arrPicture)
imgPigJaw.Image = Image.FromStream(ms)
Having successfully acheived this project I have now decided to start an ASP.NET version of the same project.

I have used an image control in place of the picturebox control. But the above code does not work at all. Firstly with imgPigJaw.Image I get the warning
'Image' is not a member of System.Web.UI.WebControls.Image
Also at Image.FromStream(ms) I get
'Image' is ambiguous, imported from the namespaces of types 'System.Web.UI.WebControls, System.Drawing'
I have played around a little hoping to wing it, but I can't find a ASP.NET alternative to convert my memory stream back to an image.

Please help!!

Thanks, Dave. :D
 
No problem I've zipped up the project for you, it's been scanned for viruses so it's safe. :D

Thanks, Dave. :D
 

Attachments

Last edited by a moderator:
Compile fine here - didn't get either of the errors you mentioned above. If you are getting any errors could you give an indication of where - 900+ lines of code is a lot to try and guess where a problem lies.
 
Back
Top