Search code examples
databaselinq-to-sqlwindows-phone-7.1background-service

LINQ to Sql DataBase access from background service in Windows Phone


I have a Windows Phone app which uses Linq to Sql to store and retrieve data from the DataBase which resides in Isolated Storage. Now if I create a background service for my app, whether the DataBase can be accessed by the background service? According to MSDN:

A local database runs in the Windows Phone application’s process. Unlike a client-server database such as Microsoft SQL Server, it does not run continuously as a background service.


Solution

  • Yes, you can access that DB from Background Agent!

    A local database runs in the Windows Phone application’s process.

    That means your database is not running unless any part of your app is actually running. It can be either you app or background agent created by that app.