(Using D8, ADO.NET, WinForms)
I have a TextEdit that is bound to a field in my DataTable
(dtPeople['FName']).
Step 1: Starting value of (dtPoeple['FName'] = "Joe") therefor
(TextEdit1.text = "Joe")
Step 2: User types and changes TextEdit1.Text = "Joel"
Step 3: User leaves focus of that field. (So the binding kicks in and
changes the dtPeople row.)
Step 4: User Changes TextEdit1.text back to "Joe"
Step 5: dtPeople.getchanges is run after user clicks an [OK] button.
(No other changes made to anything that binds to this datatable.)
Because of the use of databinding, dtPeople.GetChanges returns this row even
though the value temporarilty changed. I don't want to post this "update"
back to the DataBase as it contains no changes. Is there a way to avoid
returning this row on GetChanges but still use DataBinding? I saw the reply
to Tucon's post on "Last state", but if I used that technique that would
mean that I have to find the same rows returned by getchanges, compare the
fields to the original row, and then remove it if necessary. Is there a
better way? (Besides not using databinding?)
Thanks for any comments or assistance given!
Ryan K
Thanks!
Ryan K
"Bill Todd" <n...@no.com> wrote in message
news:437e86d2$1...@newsgroups.borland.com...
> You will get much better help with ADO.NET questions if you ask them in
> one of the .NET newsgroups.
>
> Ryan K wrote:
>
> > Hi,
> >
> > (Using D8, ADO.NET, WinForms)
> >
> > I have a TextEdit that is bound to a field in my DataTable
> > (dtPeople['FName']).
> >
> > Step 1: Starting value of (dtPoeple['FName'] = "Joe") therefor
> > (TextEdit1.text = "Joe")
> >
> > Step 2: User types and changes TextEdit1.Text = "Joel"
> >
> > Step 3: User leaves focus of that field. (So the binding kicks in and
> > changes the dtPeople row.)
> >
> > Step 4: User Changes TextEdit1.text back to "Joe"
> >
> > Step 5: dtPeople.getchanges is run after user clicks an [OK] button.
> >
> > (No other changes made to anything that binds to this datatable.)
> >
> >
> > Because of the use of databinding, dtPeople.GetChanges returns this
> > row even though the value temporarilty changed. I don't want to post
> > this "update" back to the DataBase as it contains no changes. Is
> > there a way to avoid returning this row on GetChanges but still use
> > DataBinding? I saw the reply to Tucon's post on "Last state", but if
>
> You should be able to compare the old and new values for each field and
> if they are the same call the DataRow's RejectChanges method. If the
> database you are using makes the old and new values of fields available
> in a before update trigger you could also compare the values and reject
> the update in the trigger.
>
> --
> Bill Todd (TeamB)
>
Ryan K wrote:
> Hi,
>
> (Using D8, ADO.NET, WinForms)
>
> I have a TextEdit that is bound to a field in my DataTable
> (dtPeople['FName']).
>
> Step 1: Starting value of (dtPoeple['FName'] = "Joe") therefor
> (TextEdit1.text = "Joe")
>
> Step 2: User types and changes TextEdit1.Text = "Joel"
>
> Step 3: User leaves focus of that field. (So the binding kicks in and
> changes the dtPeople row.)
>
> Step 4: User Changes TextEdit1.text back to "Joe"
>
> Step 5: dtPeople.getchanges is run after user clicks an [OK] button.
>
> (No other changes made to anything that binds to this datatable.)
>
>
> Because of the use of databinding, dtPeople.GetChanges returns this
> row even though the value temporarilty changed. I don't want to post
> this "update" back to the DataBase as it contains no changes. Is
> there a way to avoid returning this row on GetChanges but still use
> DataBinding? I saw the reply to Tucon's post on "Last state", but if
You should be able to compare the old and new values for each field and
--
Bill Todd (TeamB)