Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter datatable using between in c#

I am using data table with c# and i want to filter data table with between.but when i run my code following exception is thrown "The expression contains unsupported operator 'Between'"

here is the code:

string str = "ITEM_ID BETWEEN  " + textEdit1.Text + " AND  " +    textCUS_COA_CODE.Text + " ";

DataTable dt = new DataTable();
dt = this.pAK_ASIADataSet.sp_STOCKS_report;

dt.DefaultView.RowFilter =str;
like image 530
user1448783 Avatar asked Feb 19 '13 06:02

user1448783


1 Answers

I haven't tried it out, but using "ITEM_ID >= bla AND ITEM_ID <= bla2" should work fine.

like image 189
robert.oh. Avatar answered Sep 17 '22 15:09

robert.oh.