Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6776759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:04:02+00:00 2026-05-26T16:04:02+00:00

I am using Entity Framework and SQL CE 4.0 with my WPF application. How

  • 0

I am using Entity Framework and SQL CE 4.0 with my WPF application. How do I set the maximum database size in accordance with this article, http://blogs.msdn.com/b/sqlservercompact/archive/2007/06/13/the-story-of-max-database-size-connection-string-parameter.aspx which states:

we don’t always grow to 4 GB, it is not wise to allocate shared memory
to accommodate all page entries/references to support 4 GB.

Currently, I get the following error when trying to add new data:

The database file is larger than the configured maximum database size.

However, the DB is only reaching close to 256MB, which is in line with the article in the link above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:04:02+00:00Added an answer on May 26, 2026 at 4:04 pm

    This seems to work:

    SqlCeConnectionFactory sqlCeConnection = 
        new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0", 
        "", "Max Database Size=4000;Persist Security Info=False;");
    DbDatabase.DefaultConnectionFactory = sqlCeConnection;
    DbDatabase.SetInitializer(new SampleData());
    

    Where the third parameter is the connection string and you change the parameter Max Database Size otherwise it defaults to 256MB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am successfully creating database (SQL Ce) using Entity Framework Code First approach (C#-WPF).
I am using Entity Framework 4 in a desktop application with SQL Compact. I
I am using the Entity Framework in a web application that utilizes SQL server
I'm using Entity Framework (1st time) on a SQL 2005 database for a data
I develop desktop-based WPF-application, that uses SQL Server 2008 R2 Database and ADO.NET Entity
Situation I'm creating a C#/WPF 4 application using a SQL Compact Edition database as
I am using Entity Framework to layer on my SQL Server 2008 database. The
I have an MVC app using Entity Framework and a SQL Server 2008 database.
I have a web application that is using Entity Framework to query a SQL
I have developed an application using Entity Framework , SQL Server 2000, Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.