Tuesday, April 5, 2011

LINQ Datasource and Error: Operator '=' incompatible with operand types 'String' and 'Int32'

Hi folks,
It's an issue when you try to filter LINQ datasource within Visual Studio, where you choose Control and then it will show "==" in the Operator as follows:

When you try to run the page, it will give you and error saying:
Operator '=' incompatible with operand types 'String' and 'Int32'

All what you need to do is to change the Convert the Parameteres into the required data type as follows:

And it will magically work!

Happy programming!!
Saed

No comments:

Post a Comment