So the question is this, I have a for each loop that I am currently using to retrieve data from a query of an XML file which then gets put into a string; like so:
foreach (var value in dateQuery)
date = value.Element("HistoryCreation").Value;
I know for a fact (Based on the way the xml file stores values and the query being used) that there will only be one value in dateQuery.
Thus, I would like to know (for the purposes of making my program more efficient and learning how to code better), is there a better way to do this or are foreach's the only way?