写成trSearchChar = "Description LIKE '" + "%" + strSearchText + "%'";

解决方案 »

  1.   

    yes, it should work, for example, the output is 1 and 1:
    DataTable dt = new DataTable();
    dt.Columns.Add("Col1",typeof(string));
    dt.Columns.Add("Col2",typeof(string)); for (int i=0; i < 3; i++)
    {
    DataRow dr = dt.NewRow();
    dr["Col1"] = i.ToString();
    dr["Col2"] = (i+ 1).ToString();
    dt.Rows.Add(dr);
    } DataView dv = new DataView(dt, "Col1 like '%2%'","", DataViewRowState.CurrentRows);
    Console.WriteLine(dv.Count); dv = new DataView(dt, "Col2 like '*2'","", DataViewRowState.CurrentRows);
    Console.WriteLine(dv.Count);