.haschanges ?

here it is:

        sform.Validate()
        sform.ROInvRecallBindingSource.EndEdit()
        If sform.RO_InvRecall_DS1.HasChanges() Then
            IsDirty = True
        Else
            IsDirty = False
        End If

the problem:
if I DO NOT call the "ENDEDIT" AND/OR THE "VALIDATE" methods "HASCHANGES" always comes back FALSE
if I DO call the "ENDEDIT" AND/OR THE "VALIDATE" methods "HASCHANGES" always comes back TRUE

whether I make changes to the DS or not - the changes are in the dataset correctly???

Can anyone shed some light on this issue for me?
MBHEY131Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
If you do not call EndEdit, the DataSet is not changed, because the data has not been transferred from the controls to the DataSet. This is what EndEdit does.

Now, if EndEdit always set HasChanged to True, its because something has changed. It might not be something that has been changed on the form itself by the user. It can be something that is triggered by the code. Check the code carefully to make sure that it does not make changes to the controls values or directly to the table(s) in the DataSet.
MBHEY131Author Commented:
Check the code carefully to make sure that it does not make changes to the controls values or directly to the table(s) in the DataSet.
++++++++++++++++++++++++++++++++++++++
That was an earlier thought I had and upon inspection of the code (I DON'T KNOW) what's changing the set - however I am testing a datepicker chunk of code that I made a short date so no time gets saved but after a save nothing changes?? what I mean is that my issue does not change!

will look at the code more closely!
MBHEY131Author Commented:
Is there a chunk of code I could put together in .haschanges that would let me know the offending control that's transferring the different info from the original dataset?
Jacques Bourgeois (James Burger)PresidentCommented:
First of all, it is possible that the change is made by the code, not by a control. This is why I suggested that you revise your code.

Second, its not the DataSet that is changed, it's the tables that it contains. The DataSet is a container of tables, not a container of data. So when the data changes, its a DataTable that is changed, not the DataSet. The DataSet changes only when you add or removed tables from it.

There is are a couple of events that are triggered whenever a change is done to a DataTable. You might catch that event, pause in it with a breakpoint, and look at the Call Stack to know what triggered the change.

First create an event method to catch the event, something like the following:

	Private Sub table_RowChanging(sender As Object, e As DataRowChangeEventArgs)
		If e.Action = DataRowAction.Change Then
			Console.Beep()
		End If
	End Sub

Open in new window


Put a breakpoint on the Console.Beep

Now, to attach this event with your table, add a line like the following somewhere after the table has been filled, but before you start working with it in the code:

	AddHandler RO_InvRecall_DS1.Tables(0).RowChanging, AddressOf table_RowChanging

Open in new window


The event should be called everytime there is a change in the table. It will hit your breakpoint. With luck, the Call Stack will tell you what changed the line. If needed, you can explore e.Row in the debugger to know what row was changed.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MBHEY131Author Commented:
Thanx for the info!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.