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


VulpesRank #55 · 29.2K reputationPosted Jan 22, 2013, 1:58 PM EST
// need this using directive if not already there
using System.Xml.Linq;
// in Form_Load
Tommy103 reputationPosted Jan 22, 2013, 2:35 PM EST
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 :))
VulpesRank #55 · 29.2K reputationPosted Jan 23, 2013, 12:26 AM EST
Tommy103 reputationPosted Jan 23, 2013, 12:43 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 23, 2013, 1:02 AM EST
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.
Tommy103 reputationPosted Jan 23, 2013, 10:32 AM EST