I have a very simple question:
What is the easiest way to migrate from a standard ADO.NET datatable that has this structure in VB.NET:
myDataTable = New System.Data.DataTable("test")
myDataTable.Columns.Add(New DataColumn("x1"))
to an in memory SQLiteDataTable that will support SQL queries like these: "SELECT min(x1) FROM test" or "SELECT DISTINCT(x1) FROM test GROUP BY x1"
Thanks.
Uncle John
How to replace an ADO.NET Datatable with SQLiteDataTable
-
- Posts: 1
- Joined: Fri 11 Sep 2009 22:31
You don't need to care about creating a table schema manually - it will be created automatically when you use Devart.Data.SQLite.SQLiteDataTable (it is necessary to create a table schema manually with System.Data.DataTable). The corresponding usage of Devart.Data.SQLite.SQLiteDataTable can be the following:
Code: Select all
Dim myDataTable As SQLiteDataTable = New SQLiteDataTable("SELECT DISTINCT(x1) FROM test GROUP BY x1", "DataSource=mydatabase.db")
myDataTable.FetchAll = True
myDataTable.Active = True //schema is created, SqlDataTable is filled up with data
For more information, please refer to http://www.devart.com/dotconnect/sqlite/docs/ , the Index tab, the SQLiteDataTable Class part.