Search code examples
c#sql-server-cefilesize

Increase the size of sql compact 3.5 .sdf file


I'm using Sql Compact3.5 as my DB with C# .NET what is the maximum size of sdf that I can give? Is there any way to programatically increase the maximum size of the sdf file? If so how?


Solution

  • The maximum size of the database is by default 128 MB. Override this by using the following connection string.

    Data Source=MyData.sdf;Max Database Size=256;Persist Security Info=False;
    

    (from: http://www.connectionstrings.com/sql-server-2005-ce) and (from: http://msdn.microsoft.com/...)

    The absolute maximum size of the database is 4gb.