Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bind a DataGridView to a SQLite Database?

I'm trying to add a data connection to a datagridview that uses SQLite. I've added the reference to SQLite (downloaded the required files) but when I go through the wizard to add a data source, SQLite is not included in the choices - see screenshot below:

Change Data Source

I've looked around for answers to this question but have not been successful in finding any.

Here is a screenshot of the database inside my project folder:

project folder

Is there any way to bind the datagridview to a sqlite data source?

Any help would be appreciated.

Thanks!

like image 532
user2101411 Avatar asked Oct 17 '17 20:10

user2101411


1 Answers

The steps below are copied from http://geekswithblogs.net/danielggarcia/archive/2013/12/22/portable-databases-ii-using-sqlite-with-entity-framework.aspx:

  1. Go to Tools > Library Package Manager > Manage NuGet Packages for solution...
  2. Choose the Online section and write SQLite inside the textbox located on the upper-right corner. Push ENTER and wait for the search to be performed.
  3. Choose the first package: System.Data.SQLite (x86/x64).
  4. Once the package has been downloaded, select the project in which to install the provider and press OK.

If the data source still isn't available after following the above steps don't work, it may be a problem with the SQLite version - see the comment left by cmc and the linked thread, which says version 1.0.93 works but version 1.0.94 doesn't.

like image 186
Steve Chambers Avatar answered Sep 19 '22 01:09

Steve Chambers