PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Data binding
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Data binding
![]() |
Data binding |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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. >. > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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. >>. >> >. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

