Solved

SQLite with C# using SQLiteWrapper

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

749 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