Row state not working

J

John

Hi

I have a winform db app that uses the following code to bind data source to
the form fields;

Private ds As MyDataSet
Dim db As System.Windows.Forms.Binding
Private WithEvents bmCompanyDetails As
System.Windows.Forms.CurrencyManager

db = New System.Windows.Forms.Binding("Text", ds.tblClients, "ID")
txtID.DataBindings.Add(db)

db = New System.Windows.Forms.Binding("Text", ds.tblClients,
"Company")
txtCompany.DataBindings.Add(db)

'...more field bindings

bmCompanyDetails = CType(BindingContext(ds, "tblClients"),
CurrencyManager)

EndWait()

When the user edits some fields and presses Save, following code is
executed;

Dim Row As DataRow

bmCompanyDetails.EndCurrentEdit()
Row = DirectCast(bmCompanyDetails.Current, DataRowView).Row
If Row.RowState = DataRowState.Modified Then
' Update here
End IF

Problem is that despite the fact data is changed in bound fields,
Row.RowState returns Unchanged state. What is the problem and how can I fix
it?

Thanks

Regards
 
J

Jibesh

John,

Are sure you were not called AcceptChanges() method of dataset any where in
the program flow before the Save operation peformed.

Also make sure that editing is done on the proper row. try changing the
textbox field value fully rather changing some chars.

Thanks
Jibesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top