Extension readers for https://github.com/praeclarum/sqlite-net project.
This extension let to query the database without binding to a specific class. The results are Dictionnary of <string, object>. Each key contains ColumnName, Value contains data.
Platform | Available |
---|---|
PCL (Profile 111) | ✓ |
-
Add nuget package:
Install-Package MvvX.Plugins.HockeyApp
-
In your source file, add the following line in usage declaration section:
using SQLite_Net.Extensions.Readers;
-
In your source file, call ExecuteReader method
var readerResults = connection.ExecuteReader("SQL Query");
void ExecuteCustomQuery(SQLiteConnection connection)
{
var tableName = "<SetTableName>";
// Execute reader :
var readerResults = connection.ExecuteReader("SELECT * FROM " + tableName);
Console.WriteLine("Read data from table " + tableName);
// Showing results :
foreach (var readerItem in readerResults)
Console.WriteLine(string.Join(";", readerItem.Fields.Select(e => e + ":" + readerItem[e])));
Console.WriteLine("End read data");
}
If you have any questions, problems or suggestions, create an issue.