计算表行值 [英] Count Table row values

查看:81
本文介绍了计算表行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds我有一个任务就像这个表有一个值

Hi frnds i have an task like The table has an value as

0 1 1 1 0 0
This actually the 1 row in this i need to find how mny 0's and 1's where present in it 





请帮帮我谢谢... ,,



pls do help me Thank You...,,

推荐答案

int noofzerors=0;
                int noofones = 0;
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    if (dt.Rows[0][i].ToString() == "0")
                    {
                        noofzerors++;
                    }
                    if (dt.Rows[0][i].ToString() == "1")
                    {
                        noofones++;
                    }

                }
                here you will get your result....regards :)


检查以下链接



count.php [ ^ ]



使用不同的计数。



希望它会有所帮助..
Check the below link

count.php[^]

use count with distinct.

Hope it will help..


这篇关于计算表行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆