Why update not work?

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
W

Woody Splawn

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?
 
You have to use a command builder and call the dataset's
update method if you want to ensure update

rufus
 
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.
 
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" <[email protected]>
| 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: <#[email protected]>
| 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!TK2MSFTNGP11.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?
|
|
|
|
 
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
 
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
 
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
 
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" <[email protected]>
| References: <#[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP10.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
|
|
|
|
 
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" <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| References: <#[email protected]>
<[email protected]>
<[email protected]>
| 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: <[email protected]>
| Date: Mon, 22 Sep 2003 18:44:38 GMT
| NNTP-Posting-Host: 213.224.174.62
| X-Complaints-To: (e-mail address removed)
| 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!newsfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!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" <[email protected]> schreef in bericht
| | > 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
| >
| >
| >
|
|
|
 
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.
 
Back
Top