Link to home
Start Free TrialLog in
Avatar of kdunnett
kdunnett

asked on

select statement against datatable (distinct, certian columns, etc)

Hey,

I have a question regarding doing a select statement against a datatable.  I'm familiar with datatable.select(...), but what I need/want is more doing a full select statement instead of just customizing the expression section of the select statement.  For example:

Datatable:
id     name     value
1      temp      1
2      temp      1
3      xxx         1
4      xxx         1
5      yy          1
6      yy          0
7      yy          0
8      yy          1

What sql I want against the datatable:
select distinct name, value from DATATABLE where value = 1

result:
name     value
temp      1
xxx         1
yy          1


I know I can do the where clause in the datatable.select(), but how would you do the distinct and then select certian columns?

Thanks in advance,
Kris
ASKER CERTIFIED SOLUTION
Avatar of athapa
athapa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kdunnett
kdunnett

ASKER

Can you give an example?
is there something similiar to the .ToTable method in .net 1.1?
I found a ToTable method that someone created that mimic's the ToTable method in the 2.0 framework.

Thanks for pointing me in the right direction.

Kris