public static void Main()
DataTable dt = new DataTable();
dt.Columns.Add("xxx", typeof(string));
DataView dv = dt.DefaultView;
dv.RowFilter = " xxx like '[%%]'";
Console.WriteLine(dv.Count);
public static string EscapeLikeValue(string str)
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str.Length; i++)
if (c == '*' || c == '%' || c == '[' || c == ']')
sb.Append("[").Append(c).Append("]");