Click here to Skip to main content
15,887,895 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI EXPERTS

I have developed a windows application. Its working fine in my pc. When i try to run on User Machine image not loading on Picture box. Showing error as System.IO.IOException: The directory name is invalid.

I not using a picture box control. I am using a third party component for loading the image.


Please provide suggestions.

Rgds
Jagadesh
Posted
Comments
Sergey Alexandrovich Kryukov 1-May-13 23:38pm    
Which part of "The directory name is invalid" is not clear?
—SA
Kumar from madras 1-May-13 23:46pm    
HI SERGEY
I am reading the image from database and writing in Local D Drive and from the D Drive i am assigning the image to my picture box. In my User pc it is showing error as The Directory name is invalid.
Sergey Alexandrovich Kryukov 1-May-13 23:55pm    
Why loading it anywhere?! You should read it into memory, which is only needed to show it on screen.
At least use a valid directory.
—SA
Kumar from madras 2-May-13 0:08am    
I am not clear kindly explain me what to do ?

Please see my comment to the question. What to do?

Honestly, you will find more than enough code samples: http://www.codeproject.com/search.aspx?doctypeid=1&q=database+%28image+OR+images%29[^].

—SA
 
Share this answer
 
Your computer has a D drive. The other computer has no D drive. Crash.
Solution: if you have to write the picture to a file on disk first, use an existing folder for that. An example is System.IO.Path.GetTempPath(). Do not forget to clean up afterwards.
 
Share this answer
 
Comments
Kumar from madras 2-May-13 3:37am    
HI BERNHARD

Image are writing in the D Drive on User PC While at the time of assigning the path to the picture box i am getting the error Address in not a valid
Bernhard Hiller 2-May-13 3:50am    
Then contact the manufacturer of the third party control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900