Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why my .GetChanges() does not work?
Message
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01445923
Message ID:
01445930
Views:
27
>Hi,
>
>I have a form with controls (textboxes) bound to a typed dataset oMyDs. I change a value in one of the text boxes and click on a button (created for testing). In the click method of this form I do the following:
>
>
>DataSet dsChanges = oMyDs.GetChanges(DataRowState.Modified);
>
>
>Then I inspect the value of dsChanges and it is NULL. What am I missing?

UPDATE TO MY INITIAL MESSAGE: I think (maybe) the reason dsChanges gets NULL value is that there are no changes in the dataset. I wrote a few lines of code checking the .current and .original values for all columns in the row where I made the change but the values are the same. I must be doing something wrong in the way I bind the textboxes. Here is my code of binding the testbox to the typed dataset:
this.txtTextBoxName.DataBindings.Add("Text", bindingSource1, "ColumnName");
The values from the dataset/datatable do appear in the text boxes. But could it be that the changes do not get updated back to the dataset?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform