Hi,
I have this code:
and i want the informatiom that i give. ('Pink') be given by a textbox
How can i do it? thanks
- private void button1_Click(object sender, EventArgs e)
- {
- XDocument doc = XDocument.Load(@"C:\Work\stores.xml");
- var xpath = "//store/Color[text() ='Pink']";
- var result = ((IEnumerable)doc.XPathEvaluate(xpath)).Cast
().FirstOrDefault(); - textBox1.Text = result.Value;
- }

Bhawna TutejaRank #2,418 · 584 reputationPosted Feb 9, 2020, 5:35 PM EST
César Goulart42 reputationPosted Feb 10, 2020, 1:03 AM EST