locked
SqliteDataReader in windows 8 Metro Style Apps RRS feed

  • General discussion

  • Hai,

               I need to read values from sqlite database.I have installed sqlite for windows runtime and sqlite.net from manage nuget packages.There is no SqliteDataReader in the File sqlite.cs and SQLiteAsync.cs.can anyone pls tell me how to read values from database.thanks in Advance

    • Changed type Anne Jing Thursday, August 15, 2013 8:25 AM main about sqlite
    Thursday, August 8, 2013 6:07 AM

All replies

  • Hi ,

    You can start by reading this

    http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx

    And this is something that I use if I want to read from the database

                 

     var db = new SQLite.SQLiteConnection("database path");

                    List<tbEmployees> MyEmployees = new List<tbEmployees>();//I have a class tbEmployees which I used to open as a database table . Like the person class Tim Heur has in his example

                    db.RunInTransaction(() =>
                    {
                  
                        MyEmployees = db.Query<tbEmployees>("select * from tbemployees where auto_sequence=" + MyCurrentItem[0].Auto_Sequence.ToString() + " order by lastname");
                      
                    });
                    db.Dispose();

    And that's it.



    • Edited by zakkar Thursday, August 8, 2013 6:53 AM
    Thursday, August 8, 2013 6:53 AM
  • Hai Zakkar,

                    Thanks for u r rply.But the table which i create was dynamic.So there is no class for the table.Without class how can we read datas from the database like sqlitedatareader or any other way?

    Thursday, August 8, 2013 7:06 AM
  • Hi,smanjula

    The forum is mainly care about the problems which related to  windows store app.I think your question is concern about the how to use sqlite,so I recommand you can go to the forum which support the sqlite database to look for help!

    If you have any question about windows store app,I am willing to help!

    Best Wishes!



    • Edited by Anne Jing Friday, August 9, 2013 9:32 AM from
    Friday, August 9, 2013 9:22 AM