DataRow[]转换为DataTable
1、DataTable dtOnline = drArrary.CopyToDataTable();参考网址:https://blog.csdn.net/neo9781467/article/details/92585930
2、下面的方法是自己写的
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;
}
DataTable转换为DataRow[]
DataTable.select()就可以了
根据网上资料整理总结