Question

With my other question: Showing Multiple XML Data Entries With the Same Node Value

I have one more question, in the part:

XmlNodeList allNodes = doc.SelectNodes("/Lessons/Lesson[Date='01/01/2010']");

Is there a way to put a string with a value in it (that I already have setup) in the part '01/01/2010'?

Was it helpful?

Solution

This simple change would do...

string yourstring = "01/01/2010";

XmlNodeList allNodes = doc.SelectNodes("/Lessons/Lesson[Date='" + yourstring + "']");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top