Application may fail with buffer size error when we move the SQL Server CE database between Desktop Windows OS and WM/WCE.
Published Jan 15 2019 12:27 PM 1,167 Views
First published on MSDN on Oct 27, 2009

Symptoms



If we move the SQL Server CE database from one platform to another platform, the application may fail with the following error message



Exception type: System.Data.SqlServerCe.SqlCeException


Message: SQL Server Compact has exceeded the buffer size. The default size can be increased on initialization by modifying the ssce: max buffer size property. [ The default size = 4194304 ]


InnerException: <none>


StackTrace (generated):


SP       IP       Function


0488E9C4 0073C7A1 System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32)


0488E9C8 0073C396 System.Data.SqlServerCe.SqlCeConnection.Open(Boolean)


0488EA6C 0073BA8D System.Data.SqlServerCe.SqlCeConnection.Open()


0488EA9C 00739251 Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection()




Cause
This is by Design. When moving the SQL Server CE database from one platform to another platform, the first DB connection will re-build indexes and also the size of the database increases which requires additional buffer


Refer to our SQL Server CE Team Blog where they have given the reason for why the Size of the SQL Server CE database gets increased when we move from one platform to another.


http://blogs.msdn.com/sqlservercompact/archive/2009/04/01/after-moving-the-database-from-one-pl...



Resolution



To resolve this issue set the Buffer Size to 8MB in the connection string. The Buffer Size is in KB. The default buffer size is 640kb.
Eg:          Source=C:\Test\TestDB.sdf; SSCE:Max Buffer Size=8192



Reference
http://msdn.microsoft.com/da-dk/library/system.data.sqlserverce.sqlceconnection.connectionstrin...



Author : Praveen M(MSFT) , SQL Developer Technical Lead , Microsoft


Reviewed by : Sunil (MSFT), SQL Escalation Services , Microsoft

Version history
Last update:
‎Jan 15 2019 12:27 PM
Updated by: