My query to a large Xml Database
var query = DOC.Descendants("entry").Where(f => f.Element("url").Value.Contains("example"));
returns multiple xml Data
I display the data using a richtextbox
foreach (XElement result in query)
{richTextBox1.Text += Environment.NewLine + Environment.NewLine + result; }
<entry>
<url><![CDATA[http://triada.kh.ua/made/?email=abuse@example.com</url>
<phish_id>3779980</phish_id>
<phish_detail_url>http://www.phishtank.com/phish_detail.php?phish_id=3779980</phish_detail_url>
<details>
<detail>
<ip_address>93.190.41.34</ip_address>
<cidr_block>93.190.40.0/21</cidr_block>
<announcing_network>6849</announcing_network>
<rir>ripencc</rir>
<detail_time>2016-01-24T01:00:58+00:00</detail_time>
</detail>
</details>
<submission>
<submission_time>2016-01-22T22:42:56+00:00</submission_time>
</submission>
<verification>
<verified>yes</verified>
<verification_time>2016-03-28T14:15:01+00:00</verification_time>
</verification>
<status>
<online>yes</online>
</status>
<target>Internal Revenue Service</target>
</entry>
Please Help me.Thank you in Advance.
What I have tried:
I have tried the following code:
`
foreach (XElement result in query)
{
string display = result.ToString();
XmlReader xmlFile;
xmlFile = XmlReader.Create(new StringReader( display));
DataSet ds = new DataSet();
ds.ReadXml(xmlFile);
dataGridView1.DataSource = ds.Tables[0];
}
`
But it only displays the last XmlData and not all the values.Please Help.Thanks in advance
It looks like you're new here. If you want to get involved, click one of these buttons!