日期:2014-05-19  浏览次数:20743 次

(c# RowFilter)等待大家的帮助和解决?

    BindingSourceProductorPieceExamView.Filter   =   string.Format(@ "CuttingBatchNO   like   '{0} '   and   substring(CuttingColorNO,charindex( '# ',CuttingColorNO)+5,6)   like   '{1} ' ",
                                                                                                                                                      comBatchNO.SelectedValue.ToString(),   comColorNO.SelectedValue.ToString());
                     
大家好,我这句话运行的时候,总是报   System.Data.EvaluateException:   The   expression   contains   undefined   function   call   charindex().
   
请问有什么方法解决吗?


------解决方案--------------------
就是SubString了。比如:

private void button1_Click(object sender, EventArgs e)
{
string str = "abcdefg ";
str = str.Substring(str.Length - 3);
}