Why can't I retrieve data from table? This shows an error
The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery
1[<>f__AnonymousType1
1[System.String]]', but this dictionary requires a model item of type 'A.Models.AboutU'.
Controller
{
var selectResult = db.AboutUs.Select(s => new { des = s.Description });
return View(selectResult);
}
View
@model A.Models.AboutU
<p>
@Html.HiddenFor(model => model.Description)
@Html.DisplayFor(model => model.Description)
</p>
I have the value in the table and beeds to retrieve the description column in the table. But it seems to occur an error and not able to get the value, while using break point it shows the value in selectResult is null. Why is that getting value? Do I need to change my controller part?