get max and min value from datatable in c#
  • how to get maximum and minimum value from datatable in c# code.
  • 1 Comment sorted by
  • Vote Up0Vote Down ithackerithacker
    117.50 Karma Accepted Answer
    you can use compute function for achieve this tasks.

    For Maximum value.

    int maxValue = (int)table.Compute("MAX(Quantity)", ""); //Quantity is the column name here


    For Minimum value.

    int minValue = (int)table.Compute("MIN(Quantity)", ""); //Quantity is the column name here


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

    Optimum Creative