Here is my table sample
Busnumber st1 st2 st3 st4 st5 st6
1 abc xyz hvh cdff dfds dfds
2 abc efg vv vhv cfg vvv
3 uyt ggg xyz hhh saa pok
4 uyr abc xyz iii ppp wer
i want to select all busnumber having both stations "abc" and "xyz" together in individual busnumber here the output i want is busnumber 1 and 4
so how to how to achieve this in xml to linq query in windows phone using c# i am trying below code
XDocument loadedCustomData = XDocument.Load("best.xml");
var filteredData =
from c in loadedCustomData.Descendants("record")
///what to do below here in were clause statement ??????
where (string)c.Element ("st1") == froms.Text && (string)c.Element("st2") == to.Text ..........
select new words()
{
Busnumber = (string)c.Element("bus")
};
listBox1.ItemsSource = filteredData;
my xml sample
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<Busnumber>1</Busnumber>
<st1>Santacruz Depot</st1>
<st2>abc</st2>
<st3>Vile Parle</st3>
<st4>Mithibai College</st4>
<st5>xyz</st5>
<st6>Juhu Shopping Centre</st6>
</record>
<record>
.......
</record>