Solved

SQLite with C# using SQLiteWrapper

Posted on 2014-10-16
3
713 Views
Last Modified: 2014-10-19
I want to work on a sqlite3 database using SQL from C#. I have installed SQLitewrapper and I have the code below, which runs without error (but without any real action). I want help to get started, examples on how to scan through a table and eventually retrieve and manipulate values, and also how to run and display sql statements. Code examples can be in C#, VB6 or Foxpro.

TIA, your help is much appreciated!

        private void button1_Click(object sender, EventArgs e)
        {
            SQLiteBase db = new SQLiteBase("d:\\projects\\sqlite\\test.db");
            DataTable table = db.ExecuteQuery("SELECT * FROM fields;");
            dataGridView1.DataSource = table.TableName ;
            dataGridView1.Show();
            db.CloseDatabase();
        }
0
Comment
Question by:krhag28
  • 2
3 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 40384256
0
 

Author Comment

by:krhag28
ID: 40384373
OK, that's some good links, but all pointing to info about ODBC use. My first option is to use a COM based wrapper, and I found SQLITEWrapper.dll, which I intend to use. So the question is based on this.

However, since "everything" points in the direction of ODBC I will explore this also. Can you suggest a good and free ODBC driver?
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 40384955
I've used ODBC driver from Christian Werner: http://www.ch-werner.de/sqliteodbc/

You may also find some free client tools (e.g. http://sqlitestudio.pl) so you may access SQLite database as if you were in Management Studio.

I would guess the OLE access will be a little bit slower than ODBC.

Did you try ADO.NET provider for SQLite? It should be good option for C#: http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki

You may also look at variety of SQLite implementations on the wiki: http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question