1

I've created a SQLite3 Database by Datagrid and dragged and dropped it into the solution folder. It does not connect and it shows the following error. please, one very simple solution, I am new in OOP. Below is the screenshot.

enter image description here

thanks for your help.

5
  • Check that file is present by this path for your program. Cause when you start your program it usually starts in different folder, then the root folder of your project. Also please see this Commented May 25, 2020 at 17:46
  • hey many thanks for your reply! the file (Dokan.sqlite3) is the solution folder, as you see in the picture. but if you could be more specific with your explanation, it would really great. Commented May 25, 2020 at 17:53
  • Your code is executed from other path(when you run your code via IDE), not from the root of your solution. So "./Database/Dokan.sqlite3 will mean something like "%solution_dir%/bin/debug/Database/Dokan.sqlite3" See Tam's answer. Commented May 25, 2020 at 17:55
  • thanks, I am working on his answer. thanks a lot! Commented May 25, 2020 at 17:56
  • Please edit your question to convert images into text, and use a code block for any code you have. Readers can then search the text or run the code to reproduce your issue. Commented May 22 at 6:53

1 Answer 1

2

Looks like your "./Database/Dokan.sqlite3" file was not copied to your binary output folder, therefore when your code executed, it couldn't find any db called "./Database/Dokan.sqlite3".

Example: If your binary output folder is in c:\blahblah\bin\Debug, then you need to copy your "./Database/Dokan.sqlite3" file from your project into that directory so that "c:\blahblah\bin\Debug\Database\Dokan.sqlite3" exists. Then when your CollectionTest.exe runs from c:\blahblah\bin\Debug, it will find the db file.

Sign up to request clarification or add additional context in comments.

3 Comments

I've marked it as answer, if I did it correctly. now I am trying to print the datas correctly. I hope, I can write clear codes.
You're doing fine, Johny. Remember, "a smooth sea never made a skilled sailor"! :)
thanks, I found it but I need a lot more practice to become profi like you :)))), have a wonderful rest day!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.