I'm sorry for posting another convert type error, but after looking through and trying every example for nearly two days now, I can't get this to work.
What do I need to do to get this to work????
public IEnumerable<Product> BindProductDropDown([Control("ddBrand")] int BrandID)
{
if (BrandID > 0)
{
try
{
var prod = (from p in _DbContext.Products
join pc in _DbContext.ProductCategories on p.ProductCategoryID equals pc.ProductCategoryId
where pc.BrandID == BrandID
orderby p.OrderBy, p.Name
select new
{
p.ProductID,
p.ItemNumber
});
var c = prod.Count();
return prod;
}
catch (Exception exp)
{
ErrorLabel.Text = exp.Message;
return null;
}
}
else
{
ErrorLabel.Text = "Please select a brand from the drop drown list of brands above.";
return null;
}
}
#
public IEnumerable<Product> BindProductDropDown([Control("ddBrand")] int BrandID)
{
if (BrandID > 0)
{
try
{
var prod = (from p in _DbContext.Products
join pc in _DbContext.ProductCategories on p.ProductCategoryID equals pc.ProductCategoryId
where pc.BrandID == BrandID
orderby p.OrderBy, p.Name
select new Product
{
p.ProductID,
p.ItemNumber
});
var c = prod.Count();
return prod;
}
catch (Exception exp)
{
ErrorLabel.Text = exp.Message;
return null;
}
}
else
{
ErrorLabel.Text = "Please select a brand from the drop drown list of brands above.";
return null;
}
}