n.vanstrien asked 7 months ago

Hi Tim,
I learning a lot from you and your tutorials are really excellent because you don’t leave out any in-between steps!
For my own project I wanted to use a SQLite database, but I find it hard to find answers to my questions. I hope I can ask you a few and perhaps you would even consider a tutorial about SQLite and c# at some point in the future.
I have created a solution with 5 projects

  • a library similar to your TrackerLibrary containing models and interfaces
  • a VSTO Word addin, displaying a custom ribbon in Word 2013 (and up)
  • a WPF application for most interactions with the database that don’t require Word.
  • a console application for testing code
  • a shared project under which I created a Application_Files folder

The “Shared Project” I added because I wanted the SQLite database to be accesible from the VSTO, WPF and console solution. I added a reference to the “Shared project”  the those three projects in a similar way as I did for the library. However, I have trouble understanding reference to the files in that project. For example, my connectionstring to the local database now reads:
” <add name=”EPD” connectionString=”Data Source=C:\Users\Niels\Documents\Visual Studio 2017\Projects\dotNet\CSharp\GGZ.EPD\GGZ.EPD.SharedProject\Application_Files\DataBases\EPDData\EPDData.sqlite;Version=3;”/>”
With this connection string I can connect to the database and add/retrieve data (in a very crude form I am afraid). 
But it should of course read something like:
” <add name=”EPD” connectionString=”Data Source=|SharedProject|\Application_Files\DataBases\EPDData\EPDData.sqlite;Version=3;”/>”. But this does not work.
Then there is the question how to distribute this database (and other files) to the end-user and where to put it, so it/they won’t get deleted when updating the software.
I realize I am asking a lot. I hope you will consider to make yet another add-on course to the Tournament Tracker, showing how to add a SQLite connection in a professional way. This would also have the advantage (in my eyes) that the Tournament Tracker application could be built and made to run on a local machine without installing software.
some links I found useful:
here is also something on sqlite and dapper https://richardniemand.wordpress.com/2015/04/24/sqlite-and-dapper-in-c/
Thanks for any help you can provide.
Also, how should these files  where the database (and other) file lands on the users

2 Answers
Tim Corey answered 7 months ago

There is a lot here. Let me at least cover the basics. Yes, I will be covering SQLite in a future video. I am not sure about making another add-on course for Tournament Tracker. I am considering starting all over and doing a new start to finish project. Either way, I will most likely be including SQLite as one of the options (other possibilities for the project would include MongoDB, CouchDB, WebAPI, VueJS, WPF, .NET Core stuff, etc.)
As for where to put the database during deployment, I will be doing a deployment video shortly that will cover most of the basics of deployment. I’m pretty sure I’ll be adding this into the mix.
So basically I’m not sure I can help you specifically right now with your situation (it would take more diagnostic work than I can do right now), but I will be making videos in the near future that should help you out.

n.vanstrien answered 6 months ago

Hi Tim,
Thanks for your reply. I am looking forward to your new videos!
Kind regards,

Your Answer