473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why update not work?

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
9 1448
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gunnar Vøyenli | last post by:
Hi! For the sake of simplicity, I have three tables, Employee, Department and Work Employee >---- Department \ / \ / ^ ^ Work
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
17
by: Benoit Martin | last post by:
I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset...
9
by: zMisc | last post by:
When I try to update record, I kept getting this error: Row cannot be located for updating. Some values may have been changed since it was last read. No other users are accessing the database...
15
by: Scotty | last post by:
I like to have a good insert, update and delete code The code below sometimes workl ok sometimes doesnt work, what i am doing wrong?? Sub SaveAny() Dim command_builder As New...
1
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
1
BeemerBiker
by: BeemerBiker | last post by:
Using GridView and SqlDataSource I found that an index field defaults to "ReadOnly=True" and I have to change it to False and then hide it before my sql UPDATE command works. This seems awkward and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.