public static List<T> DataTable2List(DataTable dt, int index)
{
List<T> lst = new List<T>();
lst = (from row in dt.AsEnumerable() select Convert.ChangeType(row[0], typeof(T))).ToList();
return lst;
}
오류 1 암시 적으로 유형 'System.Collections.Generic.List을'변환 할 수 없습니다 'System.Collections.Generic.List'오류를 제거하는 방법DataTable의 배선 일반적인 방법을 목록으로
. 그리고 나는 함수의 일반성을 원하지 않는다.
이 방법을 어떻게 사용 하시겠습니까? –