Detect changes on dataset!

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.
 
S

Scott M.

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
 
A

Alec MacLean

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
 

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