I have a SQLite database added to my project in the solution explorer, named testdb.s3db. What I want to do is reference it in my code without having to fully qualify the path. Currently my code is SQLiteConnection connection = new SQLiteConnection("Data Source=C:\\Users\\Chris\\Documents\\Visual Studio 2008\\Projects\\ConsoleApplication3\\ConsoleApplication3\\testdb.s3db");
Can I do this somehow so it can be run on any machine in any path? I've tried just "testdb.s3db" but it won't work. It does work as intended when I fully qualify the path.
agent154
19
Junior Poster in Training
Recommended Answers
Jump to PostYou want it to run on any machine with any path but don't want to fully qualify it? What is the problem with choosing a path at runtime?
You have to tell the database driver where to look for the file and typically if you do not use a …
All 3 Replies
sknake
1,622
Senior Poster
Featured Poster
agent154
19
Junior Poster in Training
sknake
1,622
Senior Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.