c# - Sqlite DB querying takes a long time WP8 -


i building windows phone 8 app using sqlite.net using link reference:-

http://developer.nokia.com/community/wiki/how_to_use_sqlite_in_windows_phone

there database in project being seeded in isolated storage. database contains 1 table has 26k entries.

i trying connect database in mainpage.xaml.cs follows:-

protected override void onnavigatedto(system.windows.navigation.navigationeventargs e) {     base.onnavigatedto(e);     using (sqliteconnection db = new sqliteconnection(app._dbpath))     {         db.gettableinfo("iwmcemeteries");         try         {             list<iwmcemeteries> cemeterieslist = db.table<iwmcemeteries>().tolist<iwmcemeteries>();              messagebox.show("number of elements in table " + cemeterieslist.count);         }         catch (exception ex)         {             debug.writeline(ex.message);         }     } } 

the problem takes long(over 25 seconds) message dialog show up.

i tried alternate method running raw query follows:-

list<iwmcemeteries> cemeteries = db.query<iwmcemeteries>("select * iwmcemeteries"); messagebox.show("number of elements in list " + cemeteries.count); 

but seems take longer!(almost 30s).

can please tell me doing wrong here?

thanks,

rajeev

nothing wrong here me. people noticed, 26k rows starting work interesting bulk of data. so, in mobile devices working "lite" database, must adapt request depending on need :

  • you want number of rows, use select count(*)
  • you want display rows in list, use paging or asynchronous loading (on scroll down) fetch 20 elements each times.

in apps, in mobile devices, have consider volume of data moves.

in way, request instant , application perform well.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -