Last post Oct 02, 2008 04:40 PM by ricka6
Oct 02, 2008 10:49 AM|teckfreak|LINK
I am creating a Dynamic Data website against SQL.
When editing a Table, I get the exception, System.Web.Query.Dynamic.ParseException: Operator '==' incompatible with operand types 'Char' and 'String'.
When I checked the Table schema, it has a column with data tyoe char(1) and is a part of Composite Primary key.
Kindly guide me how to solve this error.
Oct 02, 2008 12:10 PM|ricka6|LINK
To speed up our investigation, can you create the simplest possible table that reproduces the problem. Post the T-SQL to create the table and complete instructions to reproduce the problem. EF or L2S? Leave out the Composite Primary key unless it's required
to repro the problem. I'll look into it as soon as you can post instructions.
Oct 02, 2008 12:21 PM|teckfreak|LINK
Here is the script for the Table
CREATE TABLE [Test] (
[empType] [char] (1) NOT NULL ,
CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED
To reproduce the problem
1. Create a Dynamic Data website and register a LINQ to SQL class and map this Table in L2S ORM
2. Register the L2S Data Context in Global.asax and run the Website.
3. Click Edit in the screen for the this Table.
Error "Operator '==' incompatible with operand types 'Char' and 'String' " will be displayed.
Oct 02, 2008 02:52 PM|ricka6|LINK
Thank's. I've reproduced the problem. I'll investigate and let you know what we find out. It might be a problem with LINQ to SQL - if so, I'll open a bug with that team.
Oct 02, 2008 04:40 PM|ricka6|LINK
Many thanks for reporting this problem.
I've reproduced the problem and opened a bug. The only time the bug occurs is when you use char(1) as a PK with L2S - using one char as a PK would be very limiting and quite unusual. If the char(1) is not a PK the problem doesn't occur. You can't edit the
PK, but you get the same exception when you select the details page. Until this bug is fixed you have a few options to work around the problem.
Let me know if you are able to work around this problem.