I have one picturebox in my form which loads a image from CurDir\Photos\imageName when the form gets loaded. I had given a option to change this image through OpenFileDialog.
The code I used to save the new image is:
Where,
globaldata=curdir()
stdrs.Fields(0).Value & ".jpg" is the name of the image.
The error I received is:
The process cannot access the file 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\College Management\College Management\bin\Debug\Photos\337CS10001.jpg' because it is being used by another process.
The code I used to load the image(while the form is loading) to the picturebox is:
Please help me……
The code I used to save the new image is:
VB.NET:
FileCopy(OpenFileDialog1.FileName, globaldata & "\Photos\" & stdrs.Fields(0).Value & ".jpg")
Where,
globaldata=curdir()
stdrs.Fields(0).Value & ".jpg" is the name of the image.
The error I received is:
The process cannot access the file 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\College Management\College Management\bin\Debug\Photos\337CS10001.jpg' because it is being used by another process.
The code I used to load the image(while the form is loading) to the picturebox is:
VB.NET:
PictureBox1.Image = Image.FromFile(globaldata & "\Photos\" & stdrs.Fields(0).Value & ".jpg")
Please help me……