What is the best way to handle path to different objects in the database.

T

Tony Johansson

Hello!

What is the best way to handle path to a textfile in a database and a path
to an image in the database.
I mean if I use a local SqlCe database and make a zip file of the project it
must be possible to run the project
when the project is unzipped.

//Tony
 
A

Arne Vajhøj

What is the best way to handle path to a textfile in a database and a path
to an image in the database.
I mean if I use a local SqlCe database and make a zip file of the project it
must be possible to run the project
when the project is unzipped.

One way must be to unpack the database in the same dir as the
exe and have the code look for it in the dir of the exe.

Something like:

Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]),
"foobar.sdf")

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top