Some readers asked me about the possibility to use a database file deployed as Content with the project. Using the file directly from the content folder it is not possible as we do not have read/write access to content files. In fact if we use only the silverlight assemblies we don't have access to any content file. The solution is to use TitleContainer.Openstream from Microsoft.Xna.Framework (a reference should be added manually to your project) to read the content file and then save it to the IsolatedStorage. Once we have the file on IsolatedStorage we can use SQLiteClient to access it.
I've published an updated version of the SQLiteClient project adding a content file (test.db) and there is also ExecuteScalar inside the SQLiteCommand class.
0 comments:
Post a Comment