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?