Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

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?
0
mdbarker813
Asked:
mdbarker813
  • 3
1 Solution
 
AlexFMCommented:
Use MemoryStream class instead of FileStream. Load image from database to MemoryStream. Create Bitmap from MemoryStream using Bitmap(Stream) constructor and display it.
0
 
mdbarker813Author Commented:
Do you have any sample code?Or do you know where I may find some?
0
 
AlexFMCommented:
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now