Solved

SQLite with C# using SQLiteWrapper

Posted on 2014-10-16
3
615 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 41

Expert Comment

by:pcelba
Comment Utility
0
 

Author Comment

by:krhag28
Comment Utility
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 41

Accepted Solution

by:
pcelba earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now