Okay, let's try to make my problem clear. Here are the form load en
close events. Reason I use a dataview is that I won't allow the user to
add a new record. My problem is that using 'haschanges' is not reliable
for the purpose I use it for.
dim ds1 as new dataset
Private Sub frmEditOptions_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
ds1.ReadXml(gstrFile)
Dim dv As New DataView
dv = ds1.Tables("Options").DefaultV*iew()
dv.AllowNew = False
With DataGrid1
.DataSource = dv
.CaptionText = "Options"
End With
End Sub
Private Sub frmEditOptions_Closing(ByVal sender As Object, ByVal e
As System.ComponentModel.CancelEv*entArgs) Handles MyBase.Closing
Dim s As String
If ds1.HasChanges() Then
If MsgBox("Wijzigingen opslaan?", MsgBoxStyle.YesNo +
MsgBoxStyle.Question) = MsgBoxResult.Yes Then
WriteXmlToFile(ds1, gstrFile)
End If
End If
End Sub
Cor Ligthert schreef:
Thread,
No you are missing nothing, acceptchanges mean set all datarows to the
rowstate unchanged.
I hope this helps,
Cor