XBAP application runs with partial trust security and therefore the sandbox does not allow the XBAP application to read data from a database directly. In order to read data from the database, a web service can be used to read the data from the database in the local storage and return the dataset back to the XBAP application.