I cannot get over an issue that I am having and I've been stuck on it for days.
Basically, I have an xml file mydisp.xml
Here's content of it (please note, it's complete content of xml file, without '
I'd like to retrieve elements "status, timestarted, Pack title, Client name, CE runTime, Out Time" and display on my multiple labels.text;
However, I keep having many issues. It seems c# kickes many exceptions because xml has '=' symbol and it looks more like a string.
I'd like to use Linq or xPath methods for retrieving the data as it must be very fast.
Please, can somebody help me with the code? How can I write this code and place inside onFormLoad? What used System references I must use?
Thank you everyone for your help.
Tommy

VulpesPosted Jan 22, 2013, 6:58 PM
// need this using directive if not already there
using System.Xml.Linq;
// in Form_Load
TommyPosted Jan 23, 2013, 3:32 PM
VulpesPosted Jan 23, 2013, 6:02 AM
I'd recommend getting to grips with LINQ to XML which is simpler and more logical, IMO, than previous methods of navigating XML such as XmlDocument and XPath.
TommyPosted Jan 23, 2013, 5:43 AM
VulpesPosted Jan 23, 2013, 5:26 AM
TommyPosted Jan 22, 2013, 7:35 PM
Vulpes,
Wow, I cannot believe it. This is really working. Thank you so much million times for the code.
I've spent few days on one thing and thought no matter anything I must keep myself positive and I shall get it right. But from your code it looks plain simple. Wow, positively shocked :D)
By the way, if that's not too much to ask, but c# was kicking exception because it is string and unable to accept '=' and 'whitespace' from xml. Is is really so much different if we have to some info ??
Thank you once again for the help and your time. I completely value it!! Amazing :))