我的数据集包含两个表,我需要得到FirstTable.Row2 / SecondTable.Row5的分区

时间:2010-05-12 18:31:10

标签: c# asp.net dataset

我的数据集包含两个表,我需要分割FirstTable.Row2 / SecondTable.Row5

1 个答案:

答案 0 :(得分:0)

假设类型相同且划分可以接受......我理解你的问题:

DataSet ds = GetMyData();
// You should check here for there being at least 2 tables in the DataSet
// and that Table 1 has at least 2 rows and Table 2 has at least 5 rows.
var result = 
    ds.Tables[0].Rows[1]["YourField"] / ds.Tables[1].Rows[4]["YourOtherField"];