Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

Problem setting childnodes

$
0
0
I want to edit a xml file with my vb program, I have no problems finding the right nod.
But when I try to set my textbox values as childnodes I'm getting the error:

Conversion from string "artikel" to type 'Integer' is not valid.

The textboxes ain't empty, there is just a normal word in it (mompel).


Code:

If nod IsNot Nothing Then

            nod.ChildNodes("artikel").InnerText = TextBox1.Text
            nod.ChildNodes("titel").InnerText = TextBox2.Text
            nod.ChildNodes("prijs").InnerText = TextBox3.Text
            nod.ChildNodes("foto1").InnerText = TextBox4.Text
            nod.ChildNodes("foto2").InnerText = TextBox5.Text
            nod.ChildNodes("foto3").InnerText = TextBox6.Text
            nod.ChildNodes("foto4").InnerText = TextBox7.Text
            nod.ChildNodes("foto5").InnerText = TextBox8.Text
            nod.ChildNodes("foto6").InnerText = TextBox9.Text
            nod.ChildNodes("foto7").InnerText = TextBox10.Text
            nod.ChildNodes("foto8").InnerText = TextBox11.Text
            nod.ChildNodes("omschrijving").InnerText = TextBox12.Text

        Else

            MessageBox.Show("Not found", "not found", MessageBoxButtons.OK, _
                MessageBoxIcon.Information)
        End If

I tried
Code:

nod.ChildNodes("artikel").InnerText = TextBox1.Text.ToString
as well, but it gave me the same error.
What am I doing wrong here?

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>