PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Data binding

Reply

Data binding

 
Thread Tools Rate Thread
Old 26-08-2003, 07:10 PM   #1
Gary
Guest
 
Posts: n/a
Default Data binding


I have a Windows form with several controls on it with
those controls being bound to a dataset. If I change the
value in one of the textboxes, the value is changed in
the dataset. But the HasChanges property of the dataset
comes back false and any update using the DataAdapter
comes back with 0 records updated. I can in code use
dataset.datatable.item(0).fieldname = "whatever" and then
execute the dataadapter's update command and it runs
fine. Why when I make a change in one of the controls on
the form the dataset does not recognize that the row has
changed eventhough I can see that the row has the new
value that was entered into the form control? Does the
dataset still think I am making changes to the row? Do I
somehow have to tell the dataset that I am through making
changes to the row? Any help would be good. Thanks.
  Reply With Quote
Old 26-08-2003, 10:18 PM   #2
John Viele
Guest
 
Posts: n/a
Default Re: Data binding

Sounds like you may be calling AcceptChanges() too early?

"Gary" <blue_nirvana@hotmail.com> wrote in message
news:09ec01c36bfd$5e29c700$a001280a@phx.gbl...
> I have a Windows form with several controls on it with
> those controls being bound to a dataset. If I change the
> value in one of the textboxes, the value is changed in
> the dataset. But the HasChanges property of the dataset
> comes back false and any update using the DataAdapter
> comes back with 0 records updated. I can in code use
> dataset.datatable.item(0).fieldname = "whatever" and then
> execute the dataadapter's update command and it runs
> fine. Why when I make a change in one of the controls on
> the form the dataset does not recognize that the row has
> changed eventhough I can see that the row has the new
> value that was entered into the form control? Does the
> dataset still think I am making changes to the row? Do I
> somehow have to tell the dataset that I am through making
> changes to the row? Any help would be good. Thanks.



  Reply With Quote
Old 26-08-2003, 10:20 PM   #3
Gary
Guest
 
Posts: n/a
Default Data binding

I was able to find what I needed. I am using an instance
of the CurrencyManager and then use the EndCurrentEdit
method to put my changes in the dataset.


>-----Original Message-----
>I have a Windows form with several controls on it with
>those controls being bound to a dataset. If I change

the
>value in one of the textboxes, the value is changed in
>the dataset. But the HasChanges property of the dataset
>comes back false and any update using the DataAdapter
>comes back with 0 records updated. I can in code use
>dataset.datatable.item(0).fieldname = "whatever" and

then
>execute the dataadapter's update command and it runs
>fine. Why when I make a change in one of the controls

on
>the form the dataset does not recognize that the row has
>changed eventhough I can see that the row has the new
>value that was entered into the form control? Does the
>dataset still think I am making changes to the row? Do

I
>somehow have to tell the dataset that I am through

making
>changes to the row? Any help would be good. Thanks.
>.
>

  Reply With Quote
Old 27-08-2003, 09:32 AM   #4
Puspak
Guest
 
Posts: n/a
Default Data binding

I had the same problem, and I used the same solution as
yours.
Though if you use a datagrid, you don't have to call the
EndCurrentEdit method of the currency manager concerned.
I wish it were more conistent in its approach of making
the dataset 'dirty'.

>-----Original Message-----
>I was able to find what I needed. I am using an

instance
>of the CurrencyManager and then use the EndCurrentEdit
>method to put my changes in the dataset.
>
>
>>-----Original Message-----
>>I have a Windows form with several controls on it with
>>those controls being bound to a dataset. If I change

>the
>>value in one of the textboxes, the value is changed in
>>the dataset. But the HasChanges property of the

dataset
>>comes back false and any update using the DataAdapter
>>comes back with 0 records updated. I can in code use
>>dataset.datatable.item(0).fieldname = "whatever" and

>then
>>execute the dataadapter's update command and it runs
>>fine. Why when I make a change in one of the controls

>on
>>the form the dataset does not recognize that the row

has
>>changed eventhough I can see that the row has the new
>>value that was entered into the form control? Does the
>>dataset still think I am making changes to the row? Do

>I
>>somehow have to tell the dataset that I am through

>making
>>changes to the row? Any help would be good. Thanks.
>>.
>>

>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off