Hello,
Welcome to our Microsoft Q&A platform!
TodoItem
is a model class I used in this demo, if you don't konw the model class , you could replace it by object
.
public Task<List<object>> GetItemsNotDoneAsync()
{
//return Database.QueryAsync<TodoItem>("SELECT * FROM [TodoItem] WHERE [Done] = 0");
return Database.QueryAsync<object>("SELECT * FROM [TodoItem] WHERE [Done] = 0");
}
However, if you don't known the table name, I'm afraid it is impossible. If you use sqlite-net-pcl package, this CreateTableAsync<T>
method to creat table is necessary, T
is a type of the model class you define. When you query the database via the QueryAsync
method, it also based on the model class.
For more information you can refer to
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/data/databases
https://learn.microsoft.com/en-us/xamarin/get-started/tutorials/local-database/?tabs=vswin
https://github.com/praeclarum/sqlite-net
Best Regards,
Wenyan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.