EntityDataSource在哪里?

时间:2014-09-13 14:13:11

标签: c# asp.net webforms entitydatasource

我有一个entitydatasource连接到我的数据库,我想使用“Where”属性过滤结果。作为测试,我有以下内容:

it.CustomerID is not 6

我收到以下错误:

The query syntax is not valid. Near term '6', line 6, column 25.

我猜我输入的内容是错误的,但为什么?

2 个答案:

答案 0 :(得分:0)

“Where”属性的使用遵循Entity SQL语言。所以,我认为正确的语法是:

it.CustomerID != 6

it.CustomerID <> 6

实体SQL参考 - “不等于”运算符:http://msdn.microsoft.com/en-us/library/vstudio/bb399278(v=vs.100).aspx

答案 1 :(得分:0)

删除&#39;不是&#39; to!=并确保我们不能在EntityDataSource上编写任何函数,如upper(),lower()等等,但你可以将其作为Linq查询

相关问题