您可能需要使用DataSet
而不是多个DataTable
。因为在DataSet
中,您可以使用.Tables(Index|TableName)
属性来操纵多个DataTable
属性,以确保您在右表上执行操作。你需要一个更高层次的对象来做你想做的事。
所以,如果你想删除所需的所有表中的行,只是循环和调用delete
方法:
Dim aDataSet as New DataSet
Dim absTable as New DataTable
Dim meanTable as New DataTable
Dim percTable as New DataTable
aTable.Tables.Add(absTable) aTable.Tables.Add(meanTable) aTable.Tables.Add(percTable)
For each table as DataTable in aDataSet.Tables
table.rows(2).delete
Next
你也可以有交叉表引用,以确保或操纵或做任何你想要它。
aDataSet.Tables(0) = aDataSet.Tables(1) 'only if the talbes 0 and 1 have same columns
希望这是你所要求的。
有关DatsSet的更多详细信息,请参阅http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx。
为什么不通过为每种类型的计算结果添加一个单独的列将它们全部存储在同一个表中? –