Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Loading an image from a database

This topic is 5557 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is my code to retreive a image from a database, for some reason the image.fromfile... keeps the file open after i load it, so i can''t delete it. If i can''t delete it (And because its still open) i can''t load hte next image from the database.
            If rcs.Fields("sig").Value Is System.DBNull.Value Then
                PictureBox1.Image = Nothing
                Exit Sub
            End If


            strStream.SaveToFile("C:\sTemp.bmp", ADODB.SaveOptionsEnum.adSaveCreateOverWrite)

            PictureBox1.Image = Image.FromFile("C:\sTemp.bmp")

Its in vb.net, Please help!, Thanks.

Share this post

Link to post
Share on other sites
Heh, uh, why are you creating the temporary file in the first place? Why not just set the image from the stream directly?

How appropriate. You fight like a cow.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!