locked
How to use In and between In Data Table RRS feed

  • Question

  • User809322603 posted

    Hi friends,

    I have a data table which i want to filter using between .But I am not able to apply it properly

    Please help.

    I am trying the below code.

    DataTable selectedTable;
    DataRow[] selectRow;
    string fromConcessionaireid;
    string toConcessionaireid;
    
    
    
    selectRow = finalDT.Select(string.Format("CONCESSIONAIREID between '{0}' and '{1}' ", fromConcessionaireid, toConcessionaireid));
    
      

    Thursday, April 17, 2014 5:23 AM

Answers

  • User-1509636757 posted

    I would suggest to just use >= and  <=

    selectRow = finalDT.Select(string.Format("CONCESSIONAIREID >= '{0}' and CONCESSIONAIREID <= '{1}' ", fromConcessionaireid, toConcessionaireid));

    hope it helps./.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 17, 2014 10:09 AM