开发者

My dataset contains two tables i need to get division of FirstTable.Row2/SecondTable.Row5

My dataset contains two tables i need to get d开发者_C百科ivision of FirstTable.Row2/SecondTable.Row5


Assuming the types are the same and division is acceptable... and I am understanding your question:

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"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜