Changing the BindingManagerBase.Position Property is changing the rowstate to "Modified"

  • Thread starter Thread starter SHISHIR WAHI
  • Start date Start date
S

SHISHIR WAHI

Guest
Hi!

I am using the following code to move through records in my winforms application:

Dim WithEvents BMB As BindingManagerBase
Dim WithEvents adpDoctor As New SqlDataAdapter("select * from doctors", conSMS.sqlConn)
Dim dsDoctor As New DataSet

dsDoctor.Clear()
dsDoctor.Relations.Clear()
adpDoctor.Fill(dsDoctor, "doc")
BMB = BindingContext(dsDoctor, "doc")

Private Sub BtnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
BMB.Position = 0
End Sub

Private Sub BtnPrev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrev.Click
BMB.Position -= 1
End Sub

Private Sub BtnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
BMB.Position += 1
End Sub

Private Sub BtnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
BMB.Position = BMB.Count
End Sub

The code is working fine for moving through the records but the problem is that it is changing the RowState of every traversed row of the data table to "Modified".

Please help!!!


Shishir

Continue reading...
 
Back
Top