Why update not work?

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?
 
R

rufus

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

rufus
 
W

Woody Splawn

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.
 
K

Kevin Yu

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?
|
|
|
|
 
T

tupolev

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
 
W

Woody Splawn

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
 
T

tupolev

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
 
K

Kevin Yu

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
|
|
|
|
 
K

Kevin Yu

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
| >
| >
| >
|
|
|
 
W

Woody Splawn

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top