this linq 문을 만들려고 할 때. 나는 다음과 같은 오류로 실행 :'System.Data.Common.DataRecordInternal'형식의 개체를 'System.Data.IDataReader'형식으로 캐스팅 할 수 없습니다.
Unable to cast object of type 'System.Data.Common.DataRecordInternal' to type 'System.Data.IDataReader'
이 내가 @SLaks promising answer 당 뭘하는지입니다.
List<TypeData> = reader.Cast<IDataReader>()
.Select(dr => new TypeData { Type = (string)dr["type"] })
.ToList();
당신이 당신의'TypeData' 클래스의 코드 구조를 게시 할 수 있습니까? – jp2code
또한'TypeData obj = xxx.ToList()'가 설정되어있는 것처럼 보입니다. – jp2code