When i run this code put a few items into lstF25 and press quit i dont get an error or anything but no xml file open can someone please help I havent done the other parts for the xml since i need to get this to work first if anyone has ever experienced this issue or knows anything about it and how to fix it your help would be greatly appreciated
Imports System.Xml
Public Class Form1
Dim F25int As Integer = 0
Dim F50int As Integer = 0
Dim B25int As Integer = 0
Dim B50int As Integer = 0
Dim Fullname(7) As String
Dim homeroom(7) As String
Dim Event1(7) As String
Dim F25I As Integer
Dim F50I As Integer
Dim B25I As Integer
Dim B50I As Integer
Dim xmlDoc As New XmlDocument()
Dim writer As New XmlTextWriter("participants.xml", System.Text.Encoding.UTF8)
Private Sub createNode(ByVal pEvent As String, ByVal pName As String, ByVal pHomeroom As String, ByVal writer As XmlTextWriter)
writer.WriteStartElement("Participants")
writer.WriteStartElement("Event")
writer.WriteString(pEvent)
writer.WriteEndElement()
writer.WriteStartElement("name")
writer.WriteString(pName)
writer.WriteEndElement()
writer.WriteStartElement("Homeroom")
writer.WriteString(pHomeroom)
writer.WriteEndElement()
writer.WriteEndElement()
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
If chkF25.Checked Then
lstF25.Items.Add(txtName.Text & " " & txtSurname.Text & " " & cmbHomeroom.Text)
F25int = F25int + 1
End If
If chkF50.Checked Then
lstF50.Items.Add(txtName.Text & " " & txtSurname.Text & " " & cmbHomeroom.Text)
End If
If chkB25.Checked Then
lstB25.Items.Add(txtName.Text & " " & txtSurname.Text & " " & cmbHomeroom.Text)
End If
If chkB50.Checked Then
lstB50.Items.Add(txtName.Text & " " & txtSurname.Text & " " & cmbHomeroom.Text)
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
cmbHomeroom.Items.Add("7.1")
cmbHomeroom.Items.Add("7.2")
cmbHomeroom.Items.Add("7.3")
cmbHomeroom.Items.Add("7.4")
cmbHomeroom.Items.Add("7.5")
cmbHomeroom.Items.Add("7.6")
cmbHomeroom.Items.Add("7.7")
cmbHomeroom.Items.Add("7.8")
cmbHomeroom.Items.Add("7.9")
End Sub
Private Sub btndeleteF25_Click(sender As Object, e As EventArgs) Handles btndeleteF25.Click
lstF25.Items.Remove(lstF25.Text)
F25int = F25int - 1
F25()
End Sub
Private Sub F25()
If lstF25.Items.Count > 0 Then
lstF25.SelectedIndex = lstF25.Items.Count - 1
End If
End Sub
Private Sub F50()
If lstF50.Items.Count > 0 Then
lstF50.SelectedIndex = lstF25.Items.Count - 1
End If
End Sub
Private Sub B25()
If lstB25.Items.Count > 0 Then
lstB25.SelectedIndex = lstF25.Items.Count - 1
End If
End Sub
Private Sub B50()
If lstB50.Items.Count > 0 Then
lstB50.SelectedIndex = lstF25.Items.Count - 1
End If
End Sub
Private Sub btndeleteB25_Click(sender As Object, e As EventArgs) Handles btndeleteB25.Click
lstB25.Items.Remove(lstB25.Text)
B25int = B25int - 1
B25()
End Sub
Private Sub btndeleteF50_Click(sender As Object, e As EventArgs) Handles btndeleteF50.Click
lstF50.Items.Remove(lstF50.Text)
F50int = F50int - 1
F50()
End Sub
Private Sub btndeleteB50_Click(sender As Object, e As EventArgs) Handles btndeleteB50.Click
lstB50.Items.Remove(lstB50.Text)
B50int = B50int - 1
B50()
End Sub
Private Sub btnQuit_Click(sender As Object, e As EventArgs) Handles btnQuit.Click
F25I = F25int
F25int = 0
writer.Formatting = Formatting.Indented
writer.Indentation = 2
writer.WriteStartElement("Participants")
Do While F25int < F25I
createNode(Event1(F25int), Fullname(F25int), homeroom(F25int), writer)
F25int = F25int + 1
Loop
writer.WriteEndElement()
writer.Close()
writer.Close()
xmlDoc.Load("participants.xml")
End
End Sub
End Class
When i run this code put a few items into lstF25 and press quit i dont get an error or anything but no xml file open can someone please help