Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have an application in vb.net that runs over a network. Actually shortcut of the exe file is shared over LAN, so databases remain on one computer where the application has been installed. Everything works great except one thing.

The logo of this application is saved in a database, that reports can pick to load picture. The logo file is chosen by the user, using OpenFileDialog and then saved in database. It is saved like
D:\Pictures\filename.jpg

When I run the application from network (using shortcut that we have made to the main exe file), it given error on D:\Pictures\filename.jpg because this doe not exits in the system that is running the shortcut.

How to save the logo path in a way that it always finds it in application directory, when run over the network.

Thanks and best regards,
Furqan
Posted

Because when the app runs, it runs as if it was located on your local box, and that image doesn't exist on your local box (in the specified path). You should store the image itself in the database. That would completely eliminate your problem (and future problems related to accidental deletion of the image from the hard drive).
 
Share this answer
 
Comments
Furqan Sehgal 28-Jul-11 10:43am    
Could you really tell me the statement how to save image to the database?
I have added the image field to the database but donot know how to use it.
You can use this example and save the logo on the server (in the application directory).
 
Share this answer
 
you use the
Application.ExecutablePath
for know your application executable path.
 
Share this answer
 

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