【发布时间】:2012-04-26 22:17:09
【问题描述】:
我做了以下 linq 查询
var results = from myRow in QCAllDataSet.DataTable1.AsEnumerable()
where myRow.Field<String>("ESRNumber") == value
select new ESR(myRow.ESRNumber,
myRow.CreationDate,
myRow.Subsystem,
myRow.Name,
myRow.Product,
myRow.Version,
myRow.ESRStatus,
myRow.Owner,
myRow.Priority,
myRow.LastPHNote,
myRow.LastPHNoteDate,
myRow.LastPHNoteUser,
myRow.DaysFromLastUpdate,
myRow.Customer,
myRow.T2Owner,
myRow.T2Group,
myRow.comment,
myRow.ESRAge);
我想将results 转换为ESR 对象
somthig 喜欢ESR t=(ESR)results
但我收到以下错误:
无法将类型 'System.Data.EnumerableRowCollection 转换为 ESR
我应该怎么做这个?
【问题讨论】: