-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Ravikumarcbe
Message 1 in Discussion
Hi Folks, I'm getting IOException error while trying to OpenorCreate an image
using FileStream. Image is stored in database as binary my code is,
Dim ImgPath As String
dim Img() as byte
Img=dr.item("photo")
ImgPath = "C:\" & TxtEmployeeCode.Text & ".BMP"
'If Not File.Exists(ImgPath) Then
Dim FS As New FileStream(ImgPath, FileMode.OpenOrCreate, FileAccess.Write)
FS.Write(Img, 0, UBound(Img)) 'Img is byte stored in database
FS.Close()
FS = Nothing
Img = Nothing
'End If
PicEmpPhoto.Image = New Bitmap(ImgPath)
First time it works fine, next time if I try to open the same file, I'm getting
IOException (The Process cannot access the file C:\image.bmp because it is being used
by another process)
This image is the input for picturebox control, before assigning to picturebox I have
set Picturrebox.image=nothing
Wt could be the reason, how to handle this?
Thanx in advance
Rgds,
Ravi
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]