سؤال

I dont know why I have below error:

Missing operand after ''%اح%'' operator.

on

dv.RowFilter = "[customer] LIKE N'%" + value + "%'";

also I changed code to:

dv.RowFilter = "[customer] LIKE N'%" + value.Replace(@"'", "''") + "%'";

but still I have error.

Note: I used alias for column name of table. so "customer" is alias

هل كانت مفيدة؟

المحلول

if type of field is NVARCHAR, you shouldn't use "N" in C# codes.

dv.RowFilter = "[customer] LIKE '%" + value + "%'";
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top