Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TextEdit bound to DataTable / Intermediate Value by User / .GetChanges

0 views
Skip to first unread message

Ryan K

unread,
Nov 18, 2005, 7:49:33 PM11/18/05
to
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 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


Ryan K

unread,
Nov 18, 2005, 9:01:50 PM11/18/05
to
I realized that just after I posted it... but don't want to cross post. Is
it okay in this case?

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)
>


Bill Todd

unread,
Nov 18, 2005, 7:58:42 PM11/18/05
to
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

Bill Todd

unread,
Nov 18, 2005, 8:49:30 PM11/18/05
to
Yes, repost in the appropriate group.

--
Bill Todd (TeamB)

0 new messages