我想将两个文本框绑定到xml文件中的单个列。但是,每当我点击保存时,文本框只会输入最后输入的数据集,如下所示:
保存前
保存后
如何以一种将不同数据输入保留在每个文本框中的方式绑定文本框。
这是我的代码:
Public Class Form1
Private xmlDataBind As String = My.Application.Info.DirectoryPath & "\xmlData.xml"
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.FileExists(xmlDataBind) = True Then
DataSet1.ReadXml(xmlDataBind)
End If
End Sub
Private Sub InfoBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles InfoBindingNavigatorSaveItem.Click
Me.Validate()
InfoBindingSource.EndEdit()
DataSet1.WriteXml(xmlDataBind)
End Sub
End Class