Detect changes on dataset!

  • Thread starter Thread starter Innocenti Eros
  • Start date Start date
I

Innocenti Eros

Hi all,
this is my first message in this newsgroup.
I have a question about the correct way to detect changes made on dataset.

Actually i have triggered enter and leave events of my bound textbox adding
or removing an handler for textchanged event.
I don't know if this is a good practice..

Is it possible in some way to bind the dataset haschanged() method to a
button visible property?

Is there another better way to do this?

Very thanks and sorry for my poor english :)
Eros.
 
A DataSet automatically records changes made to it by marking the rows
affected as dirty. This is how DataAdapters are able to know what changes
are to be pushed back to the original data source when DataAdapter.Update()
is called. The changes are maintained in the DataSet via the RowState
property, which is explained here:

http://www.akadia.com/services/dotnet_rowstate.html

Good luck.

-Scott
 
Hi Eros,

The dataset has a change flag indicator, which you could use something like
this in your textbox text_changed event handler:

me.cmdMyButtonName.Visible = myDatasetName.HasChanges

Which may suit your needs.

Al
 
Back
Top