我做了以下 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
对象
有点像ESR t=(ESR)results
但我收到以下错误:
无法将类型“System.Data.EnumerableRowCollection”转换为 ESR
我应该怎么做这个?