I am using SQL CE version 3.5.1. On my PC everything works fine but on the clients PC it generates the following error. I'm doing model first.
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.
I don't have any ntext or image data types. I found a couple of different posts describing a similar problem but none of the solutions fixed my issue.
I reviewed the following post The Ntext And Image Data Types Cannot Be Used In WHERE, HAVING, GROUP BY, ON, Or IN Clauses I'm not using any varchar(max) or varbinary(max) which is what this post references. I am including the sqlce dlls with the application so I don't believe it is referencing a different version but I'm waiting to find out what the client all has installed before I can confirm. I have been unable to reproduce the issue on a vm, and on my workstation.
Here is the sql that was generated when the error occurred.
SELECT 1 AS [C1],
[Extent1].[ID] AS [ID],
[Extent1].[ID] AS [ID],
[Extent1].[FirstName] AS [FirstName],
[Extent1].[LastName] AS [LastName],
[Extent1].[SLID] AS [SLID],
[Extent1].[Password] AS [Password],
[Extent1].[CreatedBy] AS [CreatedBy],
[Extent1].[CreatedDate] AS [CreatedDate],
[Extent1].[LastUpdatedBy] AS [LastUpdatedBy],
[Extent1].[LastUpdatedDate] AS [LastUpdatedDate],
[Extent2].[ID] AS [ID1],
[Extent2].[Name] AS [Name]
FROM [Users] AS [Extent1]
LEFT OUTER JOIN [Roles] AS [Extent2] ON [Extent1].[RoleID] = [Extent2].[ID]
WHERE ([Extent1].[SLID] = @p__linq__1) AND ([Extent1].[Password] = @p__linq__2)
This is generated from the following linq query.
var user = (from u in entities.Users.Include("Role")
where u.SLID == txtSLID.Text &&
u.Password == passwordHash
select u).FirstOrDefault<User>();
UPDATE Added Table Schema