虽然我知道我可以通过 sql 连接 2 行,但我的程序没有使用它
public DataTable joinTables (DataTable t1, DataTable t2)
{
DataTable joinTable = new DataTable();
foreach (DataRow r1 in t1.Rows)
{
foreach (DataRow r2 in t2.Rows)
{
///if (....)
joinTable.ImportRow(joinRows(r1,r2));
}
}
return joinTable;
}
public DataRow joinRows (DataRow r1, DataRow r2)
{
DataRow joinRow = new DataRow();
///....
return joinRow;
}