Article ID: 958478 - Last Review: October 8, 2011 - Revision: 2.0 FIX: Error message when you run a "LINQ to Entities" query that uses a string parameter or a binary parameter against a SQL Server Compact 3.5 database: "The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN...
On This PageSUMMARYThis article describes the following about this hotfix release:
SYMPTOMSConsider the following scenario. An application uses the Microsoft ADO.NET Entity Framework that is included in the Microsoft .NET Framework 3.5 Service Pack 1 to access a Microsoft SQL Server Compact 3.5 database. In the application, you run a "LINQ to Entities" query that uses a string parameter or a binary parameter against the database. In this scenario, you receive the following error message when you run the application: The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates. CAUSEWhen you use parameters for a "LINQ to Entities" query in an application, you cannot specify the base database types. The SQL Server Compact Entity Framework provider tries to create a provider-level parameter based on the Entity Data Model (EDM) facets of the original parameter. SQL Server Compact does not support the nvarchar(max) data type or the varbinary(max) data type. Therefore, when the provider selects the data type for a parameter of the Edm.String data type or of the Edm.Binary data type, the provider has to mark the parameter as one of the following data types based on the EDM facets of the parameter:
RESOLUTIONHotfix informationA supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.PrerequisitesTo apply this hotfix, you must uninstall the previously installed SQL Server Compact 3.5 Service Pack 1 to install the .msi file that is provided with this hotfix. If you do not uninstall the previously installed SQL Server Compact 3.5 Service Pack 1, you receive an installation error message that states that a later version of SQL Server Compact is already installed. For more information about SQL Server Compact 3.5 Service Pack 1, click the following article number to view the article in the Microsoft Knowledge Base:955965
(http://support.microsoft.com/kb/955965/
)
Description of SQL Server Compact 3.5 Service Pack 1
Restart informationYou do not have to restart the computer after you apply this hotfix.Registry informationYou do not have to change the registry.Hotfix file informationThis hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain all the files that you must have to fully update a product to the latest build.The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel. Collapse this table
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONAfter you apply this hotfix, the provider does not guess the data type for a parameter of the EDM.String data type or of the EDM.Binary data type. The query processor selects the correct data type for the parameter based on the value or on the column to which the parameter is equated or with which the parameter is used. For example, in the following Entity SQL query, the query processor selects the ntext data type for the name parameter before you apply this hotfix. However, in the following example, the "LINQ to Entity" query fails because the name parameter is neither equated to nor used with any other value or column. http://download.microsoft.com/download/2/e/c/2ec70436-aef2-4ccb-93a3-ea2f3e20f77d/ReadmeSSC35.htm
(http://download.microsoft.com/download/2/e/c/2ec70436-aef2-4ccb-93a3-ea2f3e20f77d/ReadmeSSC35.htm)
This hotfix resolves the issue that is related to incorrect Transact-SQL statements that are generated when the provider converts scalar subqueries to apply constructs.Note The correlated subqueries are converted to scalar subqueries internally. The correlated subqueries are not supported in this release. When you run these queries, you receive the following error message: An error occurred while executing the command definition. See the inner exception for details. There was an error parsing the query. [.., Token in error = AS ] 822499
(http://support.microsoft.com/kb/822499/
)
New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:824684
(http://support.microsoft.com/kb/824684/
)
Description of the standard terminology that is used to describe Microsoft software updates
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
