2

I'm trying to get my data that was stored in local database. I'm using for that something like this:

// Connect to the database and instantiate data context.
tablesDB = new TablesDataContext(TablesDataContext.DBConnectionString);    

// Define the query to gather all of the items.
var CategoriesTablesInDB = from CategoryItem todo in tablesDB.CategoriesTable
                                           select todo;

// Execute the query and place the results into a collection.
CategoriesTable = new ObservableCollection<CategoryItem>(CategoriesTablesInDB);

But my CategoriesTable have count = 0 after doing this, and CategoriesTablesInDB have it's sql query inside. I'm new to Windows Phone and I don't if it's the right way to do that. Is it something with my query is wrong, or I'm not doing it properly?

default
  • 11,485
  • 9
  • 66
  • 102
dziwna
  • 1,212
  • 2
  • 14
  • 25

1 Answers1

0

Sadly, can't help you with exact answer. But if you are just getting started you could also try store data in SQLite instead of native local database. It helps you build cross-platform applications in future and has a wide community support.

gleb.kudr
  • 1,518
  • 12
  • 16