<p>I' trying to use a Linq query to find and set the selected value in a drop down list control.</p>

<pre><code> Dim qry = From i In ddlOutcome.Items _
           Where i.Text.Contains(value)


 Dim selectedItem As ListItem = qry.First

 ddlOutcome.SelectedValue = selectedItem.Value
</code></pre>

<p>Even though the documentation says that the DropDownList.Items collection implements IEnumerable I get an error in the Where clause that Option Strict ON disallows late binding!</p>

My vb.net is shaky, (c# guy) but try:
```
```
Dim qry = From DirectCast(i, ListItem) In ddlOutcome.Items ...
```
```
I may have the DirectCast syntax wrong, but you know where I'm coming from. The problem is that at compile time, Items is not verifiable as as a collection of ListItem because IEnumerable's Current property returns Object. Items is not a generic collection.
-Oisin