protected void GetFinalResult(IQueryable<clsProfileData> result)
{
if (ddlHeightFrom.SelectedValue != "0" && ddlHeightTo.SelectedValue != "0")
{
int from = Convert.ToInt32(ddlHeightFrom.SelectedValue);
result = result.Where(p => Convert.ToInt32(p.Height) > from);
}
}
I am using Entity Framework 4.0
and in above method p.Height is error causing conversion(string to int).
is there any way to handle this ?
I had an error in converting a string to an Int32. I couldn’t find anywhere in the XML datadescriptions where the field was an Int32. In the end the stored proc was returning that field as an int, not a string. It’s odd that the error messaged complained that it couldn’t cast the data, in the other direction.