TryParse inside of a for loop throws an error
<p>I am trying to set some boolean values at the start of a for loop but it is throwing an 'Object reference not set to an instance of an object' error on my ASP.NET page.</p>

<p>Here is the code:</p>

<pre><code>for (int i = 0; i &lt; length ; i++)
{
    bool res = int.TryParse(Array[i],out num1);
    bool res2 = Array[i].StartsWith("AA");

    //The rest of the code
}
</code></pre>

<p>So I can't seem to figure out why I am getting this error. I have commented out both res and res2 and they both throw the error. I thought that TryParse would only return a True/False value as well as StartsWith.</p>

<p>Any Thoughts?</p>
