JavaScript:
//test.xml
<xml>
<root>
<row product_line="test1" product_name="DBManager" ref_no="u3y5v843"/>
<row product_line="test2" product_name="ASDSDAS" ref_no="23423423"/>
<row product_line="test3" product_name="5SDSFS" ref_no="67873"/>
</root>
</xml>
JavaScript:
//read xml
XDocument xdoc = XDocument.Load(file2scan);
//query1
var DBManager_recs = from p in xdoc.Root.Element("root").Elements("row")
where ((string)p.Attribute("product_name") == "DBManager")
select p;
//create a datatable
DataTable cloneTableC = new DataTable();
cloneTableC.Columns.Add("Line");
cloneTableC.Columns.Add("product");
cloneTableC.Columns.Add("ReferenceNo");
//add it to datatable
foreach (var item in DBManager_recs.ToList())
{
cloneTableC.Rows.Add(new string[] { (string)item.Attribute("product_line"), (string)item.Attribute("product_name"), (string)item.Attribute("ref_no") });
}
//give dt to datagridview
dg_argos_country.DataSource = cloneTableC;
//query2
var recs2 = from p in xdoc.Root.Element("root").Elements("row")
where ((string)p.Attribute("product_name") == "DBManager" && (string)p.Attribute("product_line") != "Translator")
select p;
if you like you can generate XSD from XML via
http://xmlgrid.net/xml2xsd.html