I am trying to count the no of rows returned from linq to sql and passing its value from controlller to view through viewBag but its is giving an error Cannot convert type 'int' to 'string'
View
@Html.Label((string)ViewBag.totalSpaces)
Controller
List<RentOutSpace> parkingSpaces = searchModel.searchSpace(address);
int count = parkingSpaces.Count();
string countSpace = count.ToString();
ViewBag.totalSpaces = countSpace;
Cannot convert type 'int' to 'string