Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道为什么我有以下错误:
Missing operand after ''%اح%'' operator.
上
dv.RowFilter = "[customer] LIKE N'%" + value + "%'";
我也将代码更改为:
dv.RowFilter = "[customer] LIKE N'%" + value.Replace(@"'", "''") + "%'";
但我仍然有错误。
注意: 我使用别名作为表的列名。所以“客户”是别名
如果字段类型是 NVARCHAR,则不应在 C# 代码中使用“N”。
dv.RowFilter = "[customer] LIKE '%" + value + "%'";