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?

7 Years
Discussion Span
Last Post by sherinpoulose

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.