in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Interfacing System.Data.SQLite with VB.NET ADO tables

Last post 02-27-2010 12:43 AM by SqlRanger. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-26-2010 9:28 AM

    • DanHi
    • Top 150 Contributor
    • Joined on 02-20-2010
    • Posts 10

    Interfacing System.Data.SQLite with VB.NET ADO tables

     I've written an app that uses Microsoft JET.  So I have data adapters like:

                   daGenres = New OleDbDataAdapter(SQL & "Genres", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBName)
    then I populate the tables with commands like:

                daGenres.Fill(ds, "Genres")
                objCB = New OleDbCommandBuilder(daGenres)
                Dim objColGenres() As DataColumn = {ds.Tables("Genres").Columns.Item("ID")}
                ds.Tables("Genres").PrimaryKey() = objColGenres

    and then use table select commands to get collections of datarows that I want to work on and then access individual fields by:

               title = row("title")

    So if I wanted to switch to System.Data.SQLite, does this entail rewriting all my code that touches the database, or can SQLite use the OleDB constructs in VB.NET?

     

    Thanks

    Dan

     

  • 02-26-2010 11:34 AM In reply to

    Re: Interfacing System.Data.SQLite with VB.NET ADO tables

    Robert implemented a managed ADO.NET provider, but not a native Ole DB provider. So, if you want to use Robert's System.Data.SQLite, you need to rewrite your application, you need to replace all OleDbConnection, OleDbCommand, OleDbDataAdapter, etc. with SQLiteConnection, SQLiteCommand, SQLiteDataAdapter, etc. This is because you are not taking advantage of ADO.NET factory pattern, and you are not using ADO.NET base classes and interfaces like DbDataAdapter, DbCommand, IDataReader, and so on.

    Regards

    Jesús López

  • 02-26-2010 1:30 PM In reply to

    • DanHi
    • Top 150 Contributor
    • Joined on 02-20-2010
    • Posts 10

    Re: Interfacing System.Data.SQLite with VB.NET ADO tables

     Once I do that, can I use VB.NET's datatables?

  • 02-27-2010 12:43 AM In reply to

    Re: Interfacing System.Data.SQLite with VB.NET ADO tables

    Of course yes.

    Regards

    Jesús López

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems