I am trying to retrieve all different months from a table in a database, but it keeps on giving me System.Collections.Generic.List1[System.String] in text on the front-end instead of the data.
var months = _db.Users.ToList().Select(o => o.dt_created.ToString("MMMM")).ToList();
ViewBag.Months = months;
What am I doing wrong?
List<T>for example) is the type name. You'd need to specify how you want to translate that object into a string, either in this code or in the view.