I am using SQLite from a Windows application, and now I am developing a portable application in Xamarin, so I am using the sqlite net pcl plugin and I am having big problems to understand how it works.
I have a table created with the following text:
public class Config { public string IP { get; set; } [SQLite.Net.Attributes.Default(true, "Client 2")] public string ID { get; set; } }
and create a table:
db.CreateTable<Model.Config>();
Problem: now I want to select a value in the ID column, and I do the following:
List<string> hhid = db.Query<string>("select ID from Config",null);
I get this exception: "Object reference not set to an instance of an object"
How can I make a simple choice to find this field?
Thanks for any feedback.
c # sqlite portable-class-library xamarin
Ignacio Gómez
source share