# Loading large SQL Server CE databases on WP7

DevFeed: [Loading large SQL Server CE databases on WP7](<https://devfeed.tech/articles/loading-large-sql-server-ce-databases-on-wp7-38409.md>)

Original publisher: [Read original article](<https://khmylov.com/2011/11/loading-large-sql-server-ce-databases/>)

Author: Andrew Khmylov

Published: 2011-11-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [sql-server](<https://devfeed.tech/topics/sql-server.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [data](<https://devfeed.tech/tags/data.md>), [databases](<https://devfeed.tech/tags/databases.md>), [file](<https://devfeed.tech/tags/file.md>), [init](<https://devfeed.tech/tags/init.md>), [issue](<https://devfeed.tech/tags/issue.md>), [loading](<https://devfeed.tech/tags/loading.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [query](<https://devfeed.tech/tags/query.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>)

## AI overview

This article explains how to load a large SQL Server Compact database from isolated storage in a Windows Phone 7 application. It describes the maximum database size error and shows how to add Max Database Size to the connection string.

## Source excerpt

Recently I ran into an issue when trying to load the large database (approx. 50 mb) from isolated storage on WP7. Whenever I tried to query the Data Context, I got the following SqlCeException: The database file is larger than the configured maximum database size. This setting takes effect on the first concurrent database connection only. [ Required Max Database Size (in MB; 0 if unknown) = 0 ] After some searching over the web, I found this blog post covering some details of that parameter. The general work-around is adding 'Max Database Size' value (in megabytes) to the connection string, so it looks like: var connectionString = "Data Source='isostore:DB.sdf'; Max Database Size = 60"; Now your app should be able to init the data context.