PC Review


Reply
Thread Tools Rate Thread

Data binding

 
 
Gary
Guest
Posts: n/a
 
      26th Aug 2003
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
 
 
 
 
John Viele
Guest
Posts: n/a
 
      26th Aug 2003
Sounds like you may be calling AcceptChanges() too early?

"Gary" <(E-Mail Removed)> wrote in message
news:09ec01c36bfd$5e29c700$(E-Mail Removed)...
> 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
 
Gary
Guest
Posts: n/a
 
      26th Aug 2003
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
 
Puspak
Guest
Posts: n/a
 
      27th Aug 2003
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Noob question - binding data to list box (system.data.datarowview?) David Wier Microsoft ASP .NET 0 17th Apr 2008 07:03 PM
Re: Noob question - binding data to list box (system.data.datarowview?) Lloyd Sheen Microsoft ASP .NET 0 17th Apr 2008 06:23 PM
100K item data binding: Is asynchronous data binding possible? R Reyes Microsoft C# .NET 14 5th Feb 2008 10:47 PM
howto manually pull data for data binding gnih Microsoft C# .NET 0 6th Nov 2006 08:48 AM
Re: Data Binding - using inline code vs. functions vs. straight binding Alvin Bruney [MVP] Microsoft ASP .NET 0 9th Mar 2004 02:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 PM.