Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个数据集,我通过以下方式检索它
var ds = data.tables[0]
我想查找特定行中数据的出现次数
Teams | Member Boys | John Boys | Dave Girls | Sarah
所以在上面的例子中,我想得到男孩的出现次数。
使用 DataSets Compute 功能可以做到这一点吗?
data.tables[0].Compute("...","...")
尝试这个
DataRow[] rows= ds.Select("Teams = 'Boys'"); Console.WriteLine(rows.Length.ToString())