【发布时间】:2018-12-21 06:03:13
【问题描述】:
我面临错误 Object cannot be cast from DBNull to other types.
我尝试引入空值,即使得到相同的 DBNull 错误。如何处理这个错误?
List<string> List = new List<string>();
List = (from r in Dt.AsEnumerable()
orderby Convert.ToDateTime(r["StartDate"]) descending
select r["name"] + string.Empty).ToList();
【问题讨论】:
标签: c# linq datatable enumerable