首页 > 解决方案 > 如何使用 if 条件将数据行“foundRows”与值相乘

问题描述

var strExpr = "Quan > 0";
var strSort = "Quan DESC";
var foundRows = ds.Tables[0].Select(strExpr,strSort);
var no = 0;
//foundRows = Convert.ToInt32(Console.ReadKey());
if (no >= 0 && no <= 499)
{
    result = foundRows * no;
    Console.WriteLine("\n{0} * {1} = {2}", foundRows, 10, result);
}

尝试将数据行“foundrows”与基于条件(大于或小于)的值相乘。上述代码未成功构建并显示以下错误“运算符 * 无法应用于 DataRow [] 和 int 类型的操作数”

标签: c#seleniumselenium-webdriver

解决方案


推荐阅读