Hello,

I am trying to create a smart device application using vb.net 2008.

So far I am able to create this application (which is working on WinXP as well as WinCE)

but the problem I have come across is some code which I was doing in vb6.0.

I know there must be other ways of doing this but I wanted to use the way i know before learning other ways.

I have programmed with vb6.0 alot and now im doing some vb.net programming (trying to learn it)

What I am trying to do is display/edit/add/delete from an XML file when creating a smart device application.

I have the following code (which is VB6.0 code) and i put this in a module

Code:
Sub edit(ByVal file As String, ByVal top_node As String, ByVal select_SingleNode, ByVal New_Value As String)
        On Error Resume Next
        Dim xdoc As DOMDocument30
        xdoc = New DOMDocument30
        xdoc.Load(file)
        Dim studentNode As IXMLDOMNode
        studentNode = xdoc.documentElement.selectSingleNode(top_node)
        Dim skillNode As IXMLDOMNode
        skillNode = studentNode.selectSingleNode(select_SingleNode)
        Debug.Print(skillNode.nodeTypedValue)
        skillNode.nodeTypedValue = New_Value
        Debug.Print(skillNode.nodeTypedValue)
        xdoc.save(file)

    End Sub

    Public Function display(ByVal file As String, ByVal top_node As String, ByVal select_SingleNode) As String
        On Error Resume Next
        Dim xdoc As DOMDocument30
        xdoc = New DOMDocument30
        xdoc.Load(file)
        Dim studentNode As IXMLDOMNode
        studentNode = xdoc.documentElement.selectSingleNode(top_node)
        Dim skillNode As IXMLDOMNode
        skillNode = studentNode.selectSingleNode(select_SingleNode)


        display = skillNode.nodeTypedValue


    End Function
Then i set references to 'Microsoft XML, v3.0'

Then on the form I add the following code:

Code:
Private Sub Form_Load()

me.caption = display((App.Path & "\data\settings.xml"), "connection", "log")

End Sub
XML file looks like this:

Code:
<root>
  <connection>
      <log>192.168.0.251</log>
  </connection>
</root>
What the code does it allows my to select the XML file to open, then it finds the cconnection sub-root and then it finds the node in the sub-root and displays it. the edit one does the same but saves the data to the XML file (well edits the data to the XML file)

what Im trying do is convert that code so it will work in my smart device application.

I have tryed to copy that into my application but it don't work.

I don't care if the code don't look the same but as long as i can call the functions the same. (as its easyer to use)

does anyone know how to convert the code so that I can use this in a Smart Device application (vb.net 2008) ?

Hope someone can help

Thanks.