• ### Announcements

#### Archived

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

## Recommended Posts

bzroom    647
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.Write(rcs.Fields("sig").Value)

strStream.Close()

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

Kill("c:\stemp.bmp")


##### Share on other sites
Sneftel    1788
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.