ascending order foreach
<p>I am trying to check for ascending order in this array
But not sure how to use a foreach </p>

<pre><code> foreach (double d in dSize)
        {

            if (dSize.ToString() != null)
            {
                double dSize1;
                string str1 = dSize.ToString();

                bool success1 = double.TryParse(str1, out dSize1);
                if ( dSize &lt; 0.0)
                {
                    errMsg1 = " data grid should contain number &gt;= 0";
                }
                //else
                //{
                //    errMsg1 = " data grid must be entered";
                //}
            }


                *if (inputs.dSize[rowCount] &lt;= inputs.dSize[rowCount - 1])
                {
                    errMsg = "value in row " + (rowCount + 1) + " should be greater than the value in row " + rowCount;
                }
            }*
            swRpt.WriteLine(errMsg);
        }
</code></pre>

<p>I've done the second part using a for loop. Would like to change it to a foreach </p>

<p>Thanks
Sun</p>
