IEnumerable type cast
<pre><code>{
-- 
public static IEnumerable&lt;Datarow&gt; Codes(string topvalue)
    {

        DataTable itemCodes = new DataTable();

        itemCodes.Columns.Add("itemId");
        itemCodes.Columns.Add("itemCode");

        itemCodes.Rows.Add(0, firstCallingCode);
        DataTable Codes = GetAllItems().Tables[0];
        foreach (DataRow item in Codes.Rows)
        {
            if (item["ItemCode"] != DBNull.Value)
            {
                itemCodes.Rows.Add(item.Field&lt;int?&gt;("itemId"), item.Field&lt;string&gt;("itemCode"));
            }
        }
        return itemCodes.AsEnumerable();d
    }
</code></pre>

<p>how can i bind it to dropdownlist: i tried this</p>

<pre><code>ddcodes.datasource = codes.getenumerable();
ddcodes.databind();
</code></pre>

<p>when i do this i get error about typecast. i can not solve it tried a lot please help.
my method is actually this</p>

<pre><code>public static IEnumerable"Datarow" Codes(string topvalue)
</code></pre>

<p>dont know why editor took that datarow off. bracket and datarow.</p>
