By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

Dataset Problem

P: n/a
I have bound all the controls with a typed dataset, Data are retrieved
into the controls correctly. when i change the data in the control its
state did not change. It should be changed from Unchanged state to
Modified state. But it is not working.
Regards and Thanks in Advance
Asad

Apr 4 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
BK
Just out of curiosity, are you checking to see if the data is changed
before the user goes to another row? I posted a similar question here
not long ago. My problem boiled down to .NET doesn't seem to see the
changes to a field in a dataset bound to a datagrid until after the
user moves off the row. As the user moves across a row, .NET thought
the data was unchanged, even though I had modified data.

I ended up keeping a set of form level variables to track the value of
the cells. I set the values when the user changes to a new row and
then compare the values with the respective columns in the dataset if
the user hasn't moved to a different row. It wasn't a whole lot of
code, but it seemed rather kludgy to me. Oh well, it worked!

Apr 4 '06 #2

P: n/a
i am talking about the datagrid, i am talkingabout the controls such as
textboxes. If the problem remains same what should i do?

Asad

Apr 4 '06 #3

P: n/a
sorry i was not talking about the datagrid.i am talkingabout the
controls such as
textboxes. If the problem remains same what should i do?

Asad

Apr 4 '06 #4

P: n/a
VJ
Asad , you are trying to get each column changed event for a datarow.. am I
correct?

VJ

<as********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
sorry i was not talking about the datagrid.i am talkingabout the
controls such as
textboxes. If the problem remains same what should i do?

Asad

Apr 4 '06 #5

P: n/a
i have a typed dataset. I have a tableA in it. there are 4 columns of
this tabeA ie, ColA, ColB, ColC, ColD.
I have four text boxes named textboxA, textboxB, textboxC, textboxD on
my form. I have bound each textbox with each column. When i retrieve
data it is OK. When i change any data in the textbox. Amazingly changed
data are reflected in the dataset column. But it state is not set to
Modified. Is there any possibility that my typed dataset is corrupted
or damaged. Or its some necessary file is missing which works for the
tables updations.

Regards
Asad Naeem

Apr 4 '06 #6

P: n/a
BK
This is consistent with the behavior I have seen in .NET. My solution
would be to add 4 new form level variables.

Public storedValueA as String .....

Each time the user moves to a new row in the datagrid, set their value
to the corresponding value in the dataset:

storedValueA = dataset.tables(0).row(currentrow).item("ItemA")

Each time the user changes to a different cell in the same row, check
to see if they changed any data:

If dataset.tables(0).row(currentrow).item("ItemA") <> storedValueA
...
EndIf

Just so you know, My base form class has currentrow and currentcolumn
variable that is updated with each datagrid cell change just for things
like this.

Hope this helps.

Apr 4 '06 #7

P: n/a
Asad,

Often is this because people are using the acceptchanges wrong. Do you use
the acceptchanges?

Cor
Apr 4 '06 #8

P: n/a
Sir many many thanks for ur great help. But Sir I am not using
Datagrid. I am using only textboxes on my form. So plz guide me in this
sscenario.

Regards
Asad Naeem

Apr 4 '06 #9

P: n/a
i have solved the problem using binding manager and moving it position
to -1.

Apr 5 '06 #10

P: n/a
Asad,

Now I see that I thought that the data was already in the dataset fields but
you wrote in the controls.

The normal command for this is in 1.x the
Currencymamager(TheUsedDataSource)endcurrentedit. In 2.0 when you use the
bindingsource than it is the endedit.

Maybe to late but to let you know.

Cor

<as********@gmail.com> schreef in bericht
news:11**********************@z34g2000cwc.googlegr oups.com...
i have solved the problem using binding manager and moving it position
to -1.

Apr 5 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.