Im pretty new to VB, using .Net 2008, and I am saving two DataGrids, ComboBoxes, and Textbox to a txt file, using "*99*" as a terminator between each, but I am having trouble reading it back into each field. Heres my open file code.
Private Sub openbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openbtn.Click
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.Filter = "Text File|*.txt|Word Document|*.doc"
openFileDialog1.Title = "Open File..."
openFileDialog1.ShowDialog()
If Windows.Forms.DialogResult.OK Then
' Dim strFileName As String
Clear()
notebox.Text = ""
Dim myStream As System.IO.StreamReader = New System.IO.StreamReader(openFileDialog1.FileName)
Do Until myStream.ReadLine() = "*99*"
TestdbDataSet.Table1.ReadXml(myStream)
Loop
Do Until myStream.ReadLine() = "*99*"
TestdbDataSet.Table21.ReadXml(myStream)
Loop
Do Until myStream.ReadLine() = "*99*"
srcdrop1.Items.Add(CStr(myStream.ReadLine))
Loop
Do Until myStream.ReadLine() = "*99*"
srcdrop2.Items.Add(CStr(myStream.ReadLine))
Loop
notebox.Text = CStr(myStream.ReadLine)
myStream.Close()
myStream = Nothing
End If
End Sub