vendredi 1 avril 2016

How to count rows in SQLite.Net and Xamarin.Forms?

I've stored the number of strings in SQLite.Net database which are working fine and I can access the data from database. When I try to count the number of rows using CountAsync method, then it don't return the data and immediately skips all the code to execute and goes to the return statement. I've also tried to use the breakpoint but the frame not available in module comes and when I continue the execution to another breakpoint, it returns again.

I'm inserting the data as follows

List<string> places = this.ParseGetNewPlacesSoapResponse(soapResponse);
var insertDB = DependencyService.Get<IDBPath>().GetDBPath();
await insertDB.CreateTableAsync<tempPlaces>();
await insertDB.InsertAllAsync(places);

Code for counting the rows

var db = DependencyService.Get<IDBPath>().GetDBPath();
await db.CreateTableAsync<tempPlaces>();
var rows = await db.Table<tempPlaces>().CountAsync();

I'm not able to find out why its not working. It always continues to execute the code without even debugging when I'm trying it with android simulator.

Aucun commentaire:

Enregistrer un commentaire