Solved

SQLite with C# using SQLiteWrapper

Posted on 2014-10-16
3
790 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

724 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