suppose there is a datatable (in asp.net,not sql database table) with 3 columns

col1 col2 col3
high cool no
high normal no
low cool yes
low normal no
high dry yes
low dry yes

column values are like these.
col3 name is already known.


suppose col1 is selected now.then how many 'high' values(in col1) are having corresponding col3 value 'no' and how many 'high' values(in col1) are having corresponding col3 value 'yes'


This same has to be calculated for each value in col 1 and 2 corresponding to the col3 values yes and no.


How can I do it?

In database you want to achive?

In database you want to achive?

no,the table is an asp.net datatable.I tried using for loop.
problem is that at the same time, i have to check for two column indexes(one for any column(col 1 or 2) and the other for the last column3) inside a loop for table columns.
so it is giving zero as count.

What I can modify in this to get the result.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.