Nested linq Select
<p>How, I am trying to bind my 2 of my dropdownlist based on a ProductID and it's available size and available color hence if a user selects say grey, only sizes available for grey will appear and vice versa for the size. I am trying the below linq statement below, apparently it throws a "LINQ to Entities does not recognize the method 'System.String ToString()' method", I am not sure if the linq construction is right either. Can anyone please advice? Thanks.</p>

<pre><code>if (!Page.IsPostBack)
{
    using (CommerceEntities db = new CommerceEntities())
    {
        int tempNum; // ----&gt; The ProductId
        if (Int32.TryParse(litTypeSel.Text, out tempNum))
        {
            if ((ddlColor.SelectedValue == "") &amp;&amp; (ddlSize.SelectedValue == ""))
            {
                ddlColor.DataSource = (from p in db.ProductTypes
                                       where p.ProductID == tempNum &amp;&amp; (p.Size == (from s in db.ProductTypes select s.Size).ToString())
                                       orderby p.Color
                                       select new { p.Color }).Distinct();
                ddlColor.DataTextField = "Color";
                ddlColor.DataBind();
                ddlColor.Items.Insert(0, new ListItem("Select Color", "NA"));

                ddlSize.DataSource = (from p in db.ProductTypes
                                      where p.ProductID == tempNum &amp;&amp; (p.Color == (from c in db.ProductTypes select c.Color).ToString())
                                      orderby p.Size descending
                                      select new { p.Size }).Distinct();
                ddlSize.DataTextField = "Size";
                ddlSize.DataBind();
                ddlSize.Items.Insert(0, new ListItem("Select Size", "NA"));
            }
        }
    }
}
</code></pre>
