Link to home
Start Free TrialLog in
Avatar of mdbarker813
mdbarker813Flag for United States of America

asked on

Displaying an image from a SQL Database without creating a file on the hard drive.

I'd like to load an image from a SQL database without creating a file on the hard drive. It there a way to do this?
Avatar of AlexFM
AlexFM

Use MemoryStream class instead of FileStream. Load image from database to MemoryStream. Create Bitmap from MemoryStream using Bitmap(Stream) constructor and display it.
Avatar of mdbarker813

ASKER

Do you have any sample code?Or do you know where I may find some?
This is C# sample:
http://www.codeproject.com/cs/database/albumviewer.asp

See code fragment: "Display the image". I will try to find VB .NET sample which does the same.
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial