vb.net help request - Not for Plugin...but for standalone MP application (1 Viewer)

TheMightySpu

Portal Member
April 22, 2009
27
5
Middle of the UK
Home Country
United Kingdom United Kingdom
Hi all,

I was hoping I could get some help with something I'm having problems with.

I decided the other day to write something in vb.net (which is what I'm used to) but I'm having problems.

Without giving too many details away as I want it to be a surprise when I get it to a presentable state, what I am trying to do is open an XML file into a form and put all the different child node values into text boxes, so that these values can then be edited and saved back into the XML file.

I have the XML file loading with no problem, the problem comes when I try to cycle through the 'parent' nodes and extract their child nodes to the text boxes.

Once I have this sorted out and working, the rest should be really easy.

Would anyone be willing help me out or point me in the right direction to a solution?

Anyone helping will receive equal credit :)

Thanks
TheMightySpud
 

MrTRiX

Community Plugin Dev
October 28, 2006
210
41
Home Country
Canada Canada
This is code I use to go over XML nodes: (C#)

Code:
XmlNodeList xmlNodes = xmlDoc.SelectNodes("rss/channel/item");
foreach (XmlNode xmlNode in xmlNodes)
{
    Site.AddItem(xmlNode, _List);
    intItemCount += 1;
}

UPDATE: Sorry, just read you wanted it in VB.NET. C# is pretty cool you should check it out. There is plenty of answers on Google for VB.NET, and everything for that matter.
 

TheMightySpu

Portal Member
April 22, 2009
27
5
Middle of the UK
Home Country
United Kingdom United Kingdom
hehe, thought the syntax looked a bit hinky LOL.

No matter, it's helped a little, was able to futz about with it and get it to pull in the info to a list box.....

as for google, yeah, there is loads of stuff (searched for almost 2 days solidly) but none of it does what I want it to do :-/

Ah well, shall persevere :)

Thanks again
TheMightySpud
 

dobyken

MP Donator
  • Premium Supporter
  • June 8, 2009
    68
    2
    Florida Gulf Coast
    Home Country
    United States of America United States of America
    I found some code I did a few years ago that might help you. You need to do a For Each statement using the parent node
    and your child. Use selectsinglenode or selectnode to find your parent then loop through the child records using


    For Each oChild In oNode.selectNodes("YourText")
    If oChild.Attribute(1) = this then do something.

    Next oChild

    I can send you full source code if you need it but the code above cycles through an XML document.
     

    TheMightySpu

    Portal Member
    April 22, 2009
    27
    5
    Middle of the UK
    Home Country
    United Kingdom United Kingdom
    I've been looking and trying code similar to that for a while.

    The problem is, as the nodes are quite dynamic in nature, I'm having problems (each element having a different number of child nodes etc)

    Thanks though, at least it looks like I'm on the right track.

    TheMightySpud
     

    Users who are viewing this thread

    Top Bottom