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

Why update not work?

P: n/a
I have a form based on a dataset containing two tables. When I issue an
update for the dataset it works when I issue it for one table but not for
the other. In the second instance I modify a field in a grid but when I do
the update it does not think anything has changed. That is, At the time I
do the save I call a routine as follows:

Private Sub UpdateARD()
Me.BindingContext(DsMain1, "Ard").EndCurrentEdit()

Dim ModifiedChildRecords As DataTable =
DsMain1.Ard.GetChanges(DataRowState.Modified)

If ModifiedChildRecords Is Nothing Then
MsgBox("There there are NO modified records in ARD")
Else
MsgBox("THERE ARE modified records in ARD")
End If

... Rest of code
End Sub

I am getting back a message that says that there are NO modified records but
don't understand why. Anyone know what might be causing this?

Nov 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
You have to use a command builder and call the dataset's
update method if you want to ensure update

rufus
-----Original Message-----
I have a form based on a dataset containing two tables. When I issue anupdate for the dataset it works when I issue it for one table but not forthe other. In the second instance I modify a field in a grid but when I dothe update it does not think anything has changed. That is, At the time Ido the save I call a routine as follows:

Private Sub UpdateARD()
Me.BindingContext(DsMain1, "Ard").EndCurrentEdit ()
Dim ModifiedChildRecords As DataTable =
DsMain1.Ard.GetChanges(DataRowState.Modified)

If ModifiedChildRecords Is Nothing Then
MsgBox("There there are NO modified records in ARD") Else
MsgBox("THERE ARE modified records in ARD")
End If

... Rest of code
End Sub

I am getting back a message that says that there are NO modified records butdon't understand why. Anyone know what might be causing this?
.

Nov 20 '05 #2

P: n/a
It would appear that you didn't read the question. Do you or does someone
else have a response to the specific question? I mean no offense.

Nov 20 '05 #3

P: n/a
Hi Woody,

I cannot reproduce the problem you experienced. Updating a table will not
change the other table's RowStatus. Are you using a typed dataset or a
untyped dataset? Would you please tell me why you need to update the tables
separately?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| From: "Woody Splawn" <wo***@splawns.com>
| Subject: Why update not work?
| Date: Thu, 18 Sep 2003 15:37:45 -0700
| Lines: 26
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#f**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:139153
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| I have a form based on a dataset containing two tables. When I issue an
| update for the dataset it works when I issue it for one table but not for
| the other. In the second instance I modify a field in a grid but when I
do
| the update it does not think anything has changed. That is, At the time
I
| do the save I call a routine as follows:
|
| Private Sub UpdateARD()
| Me.BindingContext(DsMain1, "Ard").EndCurrentEdit()
|
| Dim ModifiedChildRecords As DataTable =
| DsMain1.Ard.GetChanges(DataRowState.Modified)
|
| If ModifiedChildRecords Is Nothing Then
| MsgBox("There there are NO modified records in ARD")
| Else
| MsgBox("THERE ARE modified records in ARD")
| End If
|
| ... Rest of code
| End Sub
|
| I am getting back a message that says that there are NO modified records
but
| don't understand why. Anyone know what might be causing this?
|
|
|
|

Nov 20 '05 #4

P: n/a
I also experience big problems with receiving the changes from a datagrid,
it will only work when I the focus goes from a datagrid to a button, the
same code in the lostfocus event off the datagrid failles 3/4 times

Tupolev

"Kevin Yu" <v-****@online.microsoft.com> schreef in bericht
news:H7**************@cpmsftngxa06.phx.gbl...
Hi Woody,

I cannot reproduce the problem you experienced. Updating a table will not
change the other table's RowStatus. Are you using a typed dataset or a
untyped dataset? Would you please tell me why you need to update the tables separately?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| From: "Woody Splawn" <wo***@splawns.com>
| Subject: Why update not work?
| Date: Thu, 18 Sep 2003 15:37:45 -0700
| Lines: 26
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#f**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:139153
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| I have a form based on a dataset containing two tables. When I issue an
| update for the dataset it works when I issue it for one table but not for | the other. In the second instance I modify a field in a grid but when I
do
| the update it does not think anything has changed. That is, At the time I
| do the save I call a routine as follows:
|
| Private Sub UpdateARD()
| Me.BindingContext(DsMain1, "Ard").EndCurrentEdit()
|
| Dim ModifiedChildRecords As DataTable =
| DsMain1.Ard.GetChanges(DataRowState.Modified)
|
| If ModifiedChildRecords Is Nothing Then
| MsgBox("There there are NO modified records in ARD")
| Else
| MsgBox("THERE ARE modified records in ARD")
| End If
|
| ... Rest of code
| End Sub
|
| I am getting back a message that says that there are NO modified records
but
| don't understand why. Anyone know what might be causing this?
|
|
|
|

Nov 20 '05 #5

P: n/a
Thank you for responding.

I discovered the problem I believe. Like Tupolev (See other message this
thread) I was experiencing the problem because the value in the field was
not getting posted when I clicked on a button in a menu. I discovered that
I need to move off the record and back back in order for the the grid to
think something has changed.

Woody

Nov 20 '05 #6

P: n/a
Do you create a new cell and set the focus then to that new cell? Because
that doesn't seem to solve the problem with me.

Tupolev
"Woody Splawn" <wo***@splawns.com> schreef in bericht
news:eM**************@TK2MSFTNGP10.phx.gbl...
Thank you for responding.

I discovered the problem I believe. Like Tupolev (See other message this
thread) I was experiencing the problem because the value in the field was
not getting posted when I clicked on a button in a menu. I discovered that I need to move off the record and back back in order for the the grid to
think something has changed.

Woody

Nov 20 '05 #7

P: n/a
Hi Woody,

I'm glad to hear that you solved the problem so quickly. If there's any
other things I can help, please feel free to post it in the newsgroup.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "Woody Splawn" <wo***@splawns.com>
| References: <#f**************@TK2MSFTNGP11.phx.gbl>
<H7**************@cpmsftngxa06.phx.gbl>
| Subject: Re: Why update not work?
| Date: Mon, 22 Sep 2003 09:22:35 -0700
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eM**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:140285
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Thank you for responding.
|
| I discovered the problem I believe. Like Tupolev (See other message this
| thread) I was experiencing the problem because the value in the field was
| not getting posted when I clicked on a button in a menu. I discovered
that
| I need to move off the record and back back in order for the the grid to
| think something has changed.
|
| Woody
|
|
|
|

Nov 20 '05 #8

P: n/a
Hi Tupolev,

I think woody means that after modifying a cell in the grid, you have set
focus to other rows so that this row might be thought as changed.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| From: "tupolev" <Zr*******@hotmail.be>
| Newsgroups: microsoft.public.dotnet.languages.vb
| References: <#f**************@TK2MSFTNGP11.phx.gbl>
<H7**************@cpmsftngxa06.phx.gbl>
<eM**************@TK2MSFTNGP10.phx.gbl>
| Subject: Re: Why update not work?
| Lines: 21
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <qq***********************@hestia.telenet-ops.be>
| Date: Mon, 22 Sep 2003 18:44:38 GMT
| NNTP-Posting-Host: 213.224.174.62
| X-Complaints-To: ab***@telenet.be
| X-Trace: hestia.telenet-ops.be 1064256278 213.224.174.62 (Mon, 22 Sep
2003 20:44:38 CEST)
| NNTP-Posting-Date: Mon, 22 Sep 2003 20:44:38 CEST
| Organization: Telenet Internet
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!newsfeed.icl.net!newsfeed.fjserv.net!proxad.n et!nerim.net!aotearoa.beln
et.be!news.belnet.be!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-fo
r-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:140338
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Do you create a new cell and set the focus then to that new cell? Because
| that doesn't seem to solve the problem with me.
|
| Tupolev
| "Woody Splawn" <wo***@splawns.com> schreef in bericht
| news:eM**************@TK2MSFTNGP10.phx.gbl...
| > Thank you for responding.
| >
| > I discovered the problem I believe. Like Tupolev (See other message this
| > thread) I was experiencing the problem because the value in the field
was
| > not getting posted when I clicked on a button in a menu. I discovered
| that
| > I need to move off the record and back back in order for the the grid to
| > think something has changed.
| >
| > Woody
| >
| >
| >
|
|
|

Nov 20 '05 #9

P: n/a
Tupolev

In my case I create a hidden button on the form. At time of update I
identify the active control, unhide the button, move to it, hide it again,
and move back to the active control. It all happens so quickely that you
never see the un-hidden button.

Nov 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.