I stuck with Xamarin.Forms SQLite.
i use this NuGet package : sqlite-net-pcl
I want to save the Data from my Table to a Variable with this following code
SQLiteConnection myconnection = new SQLiteConnection(Constants.DatabasePath);
SQLiteCommand cmd = new SQLiteCommand(myconnection);
myconnection.CreateTable<Modul>();
var Mods = myconnection.Query<Modul>("SELECT * FROM Modul");
Mods returns with = Count=0; But i have saved Data. Click here
My modul class: MoulID has Primary Key on Top [Primarykey]...
public int ModulID { get; set; }
public string Modul_Name { get; set; }
I will include my existing Database from Here
with this class
public class{
public const string DatabaseFilename = "VocalDB.db";
public static string DatabasePath
{
get
{
var basePath = "D:/C#-Projets/Vocabul/Vocabul/Vocabul/DataBase/";
return Path.Combine(basePath, DatabaseFilename);
}
}
}