Click here to Skip to main content
15,888,461 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: INI - read multiline! Pin
User 989707412-Dec-16 1:18
User 989707412-Dec-16 1:18 
GeneralRe: INI - read multiline! Pin
User 989707412-Dec-16 6:40
User 989707412-Dec-16 6:40 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen12-Dec-16 7:44
professionalEddy Vluggen12-Dec-16 7:44 
GeneralRe: INI - read multiline! Pin
User 989707412-Dec-16 8:31
User 989707412-Dec-16 8:31 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen12-Dec-16 8:44
professionalEddy Vluggen12-Dec-16 8:44 
GeneralRe: INI - read multiline! Pin
User 989707412-Dec-16 8:59
User 989707412-Dec-16 8:59 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen12-Dec-16 11:37
professionalEddy Vluggen12-Dec-16 11:37 
GeneralRe: INI - read multiline! Pin
User 989707414-Dec-16 4:45
User 989707414-Dec-16 4:45 
ok my code as changed..i googled for new code and i believe i found some that i can understand and is easy to apply.
The only problem is that is writing and reading only the first node.
How can i create new nodes and read only those that have the Date i want selected?
Please give me a hand here..this is not important as hell but i would like to be able to end my gadget... i believe i can do it with a few lines of code and is nothing really hard..but yes.. i am not understanding how to read and write more than one node...
here is my current code:

VB
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
    Dim folderPath As String = Directory.GetCurrentDirectory()
    Dim filePath As String = Path.Combine(folderPath, "MEMOS\Database.xml")
    Dim dat = TextBox1.Text
        Dim plc = TextBox2.Text
        Dim hed = TextBox3.Text
        Dim mem = TextBox4.Text
    Dim hor = ComboBox1.Text + " : " + ComboBox2.Text + " " + ComboBox3.Text
    Dim writer As New XmlTextWriter(filePath, System.Text.Encoding.UTF8)

    writer.WriteStartDocument(True)
        writer.Formatting = Formatting.Indented
        writer.Indentation = 2
    writer.WriteStartElement("MEMOSAVE")
    createNode(dat, hor, plc, hed, mem, writer)
    writer.WriteEndElement()
    writer.WriteEndDocument()
    writer.Close()
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
    Dim folderPath As String = Directory.GetCurrentDirectory()
    Dim filePath As String = Path.Combine(folderPath, "MEMOS\Database.xml")
    If Not File.Exists(filePath) Then
        MessageBox.Show("DataBase not found!")
    Else
        Dim sav = TextBox1.Text
        Dim xmlFile As XmlReader
        xmlFile = XmlReader.Create(filePath, New XmlReaderSettings())
        Dim ds As New DataSet
        Dim dv As DataView
        ds.ReadXml(xmlFile)
        dv = New DataView(ds.Tables(0))
        dv.Sort = "Date"
        Dim index As Integer = dv.Find(sav)

        If index = -1 Then
            MsgBox("Item Not Found")
        Else
            Label9.Text = (dv(index)("Date").ToString())
            Label10.Text = (dv(index)("Hour").ToString())
            Label11.Text = (dv(index)("Place").ToString())
            Label12.Text = (dv(index)("Header").ToString())
            TextBox4.Text = (dv(index)("MEMO").ToString())
        End If
        Return
    End If
End Sub


Thank you!

modified 7-Jan-19 21:02pm.

GeneralRe: INI - read multiline! Pin
Eddy Vluggen14-Dec-16 6:17
professionalEddy Vluggen14-Dec-16 6:17 
GeneralRe: INI - read multiline! Pin
User 989707414-Dec-16 6:29
User 989707414-Dec-16 6:29 
GeneralRe: INI - read multiline! Pin
User 989707414-Dec-16 6:43
User 989707414-Dec-16 6:43 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen14-Dec-16 7:08
professionalEddy Vluggen14-Dec-16 7:08 
GeneralRe: INI - read multiline! Pin
User 989707414-Dec-16 7:29
User 989707414-Dec-16 7:29 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen14-Dec-16 10:46
professionalEddy Vluggen14-Dec-16 10:46 
GeneralRe: INI - read multiline! Pin
User 989707415-Dec-16 0:36
User 989707415-Dec-16 0:36 
GeneralRe: INI - read multiline! Pin
User 989707415-Dec-16 0:38
User 989707415-Dec-16 0:38 
GeneralRe: INI - read multiline! Pin
Richard MacCutchan15-Dec-16 1:42
mveRichard MacCutchan15-Dec-16 1:42 
GeneralRe: INI - read multiline! Pin
User 989707415-Dec-16 4:37
User 989707415-Dec-16 4:37 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen15-Dec-16 5:00
professionalEddy Vluggen15-Dec-16 5:00 
GeneralRe: INI - read multiline! Pin
User 989707415-Dec-16 5:09
User 989707415-Dec-16 5:09 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen15-Dec-16 8:35
professionalEddy Vluggen15-Dec-16 8:35 
GeneralRe: INI - read multiline! Pin
User 989707417-Dec-16 1:27
User 989707417-Dec-16 1:27 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen17-Dec-16 23:46
professionalEddy Vluggen17-Dec-16 23:46 
GeneralRe: INI - read multiline! Pin
User 989707418-Dec-16 0:14
User 989707418-Dec-16 0:14 
GeneralRe: INI - read multiline! Pin
Eddy Vluggen18-Dec-16 1:16
professionalEddy Vluggen18-Dec-16 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.