c# linq用起来特方便,因此我们习惯性的用list来操作。

这里我们将 DataTable 一列转为List:

 

List<T> homeworkIdList = (from r in dataTable.AsEnumerable() select r.Field<T>("列名")).ToList<T>();

 

 

DataTable 将一列转为List

 

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案