I tried to work with SQLite with my project, and I found this tutrial and it close to the project idea. Windows Phone 8.1 SQLite: How to Store Data in Database
the code is very simple, I just modify it with my table WritePadFileContent
public WritePadFileContent ReadWritePadFileContent(int writePadFileContentid)
{
using (var dbConn = new SQLiteConnection(App.DB_PATH))
{
var existingWritePadFileContent = dbConn.Query<WritePadFileContent>("select * from WritePadFileContents where Id =" + writePadFileContentid).FirstOrDefault();
return existingWritePadFileContent;
}
}
The problem is started with
dbConn.Query<WritePadFileContent>("select * from WritePadFileContents where Id =" + writePadFileContentid).FirstOrDefault();
and the error is
Error 4 'WritePad_CSharpSample.Model.WritePadFileContent' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'SQLite.SQLiteConnection.Query(string, params object[])' C:\Users\juste 3al faza\Contacts\Documents\WritePad SDK\WritePad_CSharpMetroSample\WritePad_CSharpSample.WindowsPhone\Helpers\DatabaseHelperClass.cs 54 51 WritePad_CSharpSample.WindowsPhone
Aucun commentaire:
Enregistrer un commentaire