A "IN" like where queries on DataTable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a DataTable which is part of dataset, and has relation with other DatyaTables in the DataSet.

I have to make select on the DS tables, which its meaning is same as "IN", when I query on sql
E.G. Select T1.field1 from T1 where T1.Field2 in (select T2.field2 from T2 where ....)
Is there any built in way to do it, otherwise, what is the best practice to simulate this action
 
Nay said:
Hi
I have a DataTable which is part of dataset, and has relation with other
DatyaTables in the DataSet.
The IN Operator is supported in ADO.NET's expression syntax. So you could
create a dataview for instance on the table you want to query on

DataView dv = myTable.DefaultView;

then set the rowfilter dv = "MyColumnName IN('firstVal', 'secondValue') etc
It sounds like you are wanting to refernce values directly in a parent
ttable or child table, so as longa s the relation is there you can do it
with Parent.FieldName or Child.FieldName.

Is this what you are asking?
I have to make select on the DS tables, which its meaning is same as "IN", when I query on sql
E.G. Select T1.field1 from T1 where T1.Field2 in (select T2.field2 from T2 where ....)
Is there any built in way to do it, otherwise, what is the best practice
to simulate this action




--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
 
Back
Top