FIX: "An SqlCeParameter with ParameterName '<Parameter Name>' is not contained by this SqlCeParameterCollection" error message when you use the .NET Compact Framework Data Provider for SQL Server Compact to access SQL Server Compact 3.5

Extended support for SQL Server 2005 ended on April 12, 2016

If you are still running SQL Server 2005, you will no longer receive security updates and technical support. We recommend upgrading to SQL Server 2014 and Azure SQL Database to achieve breakthrough performance, maintain security and compliance, and optimize your data platform infrastructure. Learn more about the options for upgrading from SQL Server 2005 to a supported version here.

This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
Consider the following scenario:
  • You use the Microsoft .NET Compact Framework Data Provider for SQL Server Compact to access Microsoft SQL Server Compact 3.5.
  • The initializer of .NET Compact Framework Data Provider for SQL Server Compact contains the name of the mapped parameter that uses Unicode encoding. Or, the capitalization of the mapped parameter name differs from the capitalization of the parameter name that is defined in the Transaction-SQL query.
  • You generate an application.
In this scenario, you receive the following error message:
System.IndexOutOfRangeException: An SqlCeParameter with ParameterName '<Parameter Name>' is not contained by this SqlCeParameterCollection.

at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()

at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)

at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()

Note This issue occurs when the current thread of the application is running in one of the following cultures:
  • Kazakh
  • Turkish
  • Hungarian
RESOLUTION
The hotfix that resolves this problem is included in cumulative update package 1 for SQL Server Compact 3.5 Service Pack 2.

For more information about how to obtain the cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:

982841 Cumulative Update 1 for SQL Server Compact 3.5 Service Pack 2
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
REFERENCES
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
Turkish  Hungarian Kazakh
Properties

Article ID: 982565 - Last Review: 12/12/2015 04:18:33 - Revision: 2.0

Microsoft SQL Server Compact 3.5

  • kbnosurvey kbarchive kbfix kbqfe kbautohotfix kbhotfixserver kbsurveynew kbexpertiseadvanced KB982565
Feedback