I have followed this article on MSDN which clearly describes how to create a database using a helper application and then load it into the main application as Content. If the database is read only (which mine is), the article describes how it does not need to be loaded into isolated storage.
However after doing this and performing read-only queries on the database (Where, Select etc.), I get the following exception
The database is opened with a read-only connection. Can't perform post-initialization operations like re-building indexes and upgrading public tracking. Please re-open with a read-write connection.
This implies that the database always needs write access. How then do I use the database in read only mode as suggested by the article?
Here are the queries I am running,
IQueryable dataQuery = null;
// This line inside a switch statement which picks a particular table of clothing
dataQuery = this.clothingDB.DressSizes;
var dataBySize = dataQuery.Cast<IClothing>().Where(q => q.Size == size);
foreach (Retailer retailer in dataBySize.Select(ds => ds.Retailer).Distinct()) {
/// ... Do something
}