c# - 如何使用 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++ - 组织复杂的地图数据结构
- python - 将时间格式,字符串转换为浮点数
- r - 错误:`data` 和 `reference` 应该是相同级别的因素。使用confusionMatrix(插入符号)
- paypal - PayPal 支付 API 限制?
- jestjs - Next.js 单元测试与 jest --coverage 错误
- wordpress - 在每个 WooCommerce 产品上添加品牌徽标?
- phpstorm - PhpStorm:加载 xebug.so 失败
- c - 程序运行不佳(意味着输出(printf)),但在 gdb t.exe 中运行良好
- python - 如何限制字典中的值范围?
- wordpress - WooCommerce Eway 插件不为新客户创建客户令牌