Iterate through databound listbox
<p>My listbox is getting its items from a sql database and I'm trying to loop through it and perform an action based on a certain condition. I've done this before but not when it was attached to a db. This is the code I'm using (that doesnt work):</p>

<pre><code>foreach (object o in arrList)
{
    foreach (ListItem i in lstInstructors.Items)
    {
        if (i.Text == o.ToString())
        i.Selected = true;
    }
}
</code></pre>

<p>While I'm debugging im getting null as <code>ListItem i</code>, and I'm guessing thats because there's no static items added, so what would be the right call to get the databound items instead of using <code>lstInstructors.Items</code>?</p>
