title: compare current and next value in datatable
body: <p>i have tried to write code to compare the values in 'mainMenuNum' column of datatable. if values are not equal only then it should get printed to console.</p>
  
  <pre><code>for (int index = 0; index &lt;= numRows; index++)
  {
      if (index == 0 || index &lt;= numRows)
      {
          if (dt.Rows[index]["mainMenuNum"].ToString() != 
              dt.Rows[index  - 1]["mainMenuNum"].ToString())
          {
              Console.WriteLine(dt.Rows[index]["mainMenuNum"].ToString());
          }
      }
  }
  </code></pre>