private DataTable ToDataTable(DataRow[] rows)
{
if (rows == null || rows.Length == 0) return null;
DataTable tmp = rows[0].Table.Clone(); // 复制DataRow的表结构
foreach (DataRow row in rows)
{

tmp.ImportRow(row); // 将DataRow添加到DataTable中
}
return tmp;
}

相关文章:

  • 2021-05-31
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2022-02-03
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案