Trying to Update ONE record Updates TWO????

A

Aaron Ackerman

I am attempting a very straight forward Update on a dataset. I have a
WinForms N-Tier app
using VB.NET.
Visual DataAdapters, typed Datasets.


Me.txtHomePhone.DataBindings.Clear()
Me.txtWorkPhone.DataBindings.Clear()
Me.txtPostalCode.DataBindings.Clear()

'New field values get assigned
vdsClientUI.ClientByID.Rows(0).Item("PersonHomePhone") =
Me.txtHomePhone.Text
vdsClientUI.ClientByID.Rows(0).Item("PersonWorkPhone") =
Me.txtWorkPhone.Text
vdsClientUI.ClientByID.Rows(0).Item("PersonPostalCode") =
Me.txtPostalCode.Text

'passes dataset from the UI through the middle tier to the datalayer
objClient.UpdateClientByID(Me.vdsClientUI, "ClientByID")

'At the datalayer update gets applied
Public Overridable Function UpdateClientByID(ByRef vdsClient As
dsClient, ByRef TableName As String)
vdaClientByID.Update(vdsClient, TableName)
End Function

'I step through and get a record count of one and yet it updates BOTH
records that exist in this table?
 
A

Aaron Ackerman

As a follow up to this post. I ran a SQL Trace and that Update stored proc
is only getting called ONE time with the correct key and yet it is updating
TWO records!
 
C

Colin Young

Post your DDL and the SQL from the trace.

What happens if you run the same SQL in QA? Do you get 2 records updated?

Colin
 
K

Kevin Yu [MSFT]

Hi Aaron,

Please try Colin's suggestion to run it in QA, or try to use SELECT
statement with the same WHERE condition to see if there're more than one
records meet the condition.

BTW, did you try my suggestion to call EndEdit() after assigning value to
it?

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

--------------------
| From: "Colin Young" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Trying to Update ONE record Updates TWO????
| Date: Thu, 30 Oct 2003 09:31:11 -0500
| Lines: 51
| 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.framework.adonet
| NNTP-Posting-Host: 208.218.199.125
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:64910
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Post your DDL and the SQL from the trace.
|
| What happens if you run the same SQL in QA? Do you get 2 records updated?
|
| Colin
|
| | > As a follow up to this post. I ran a SQL Trace and that Update stored
proc
| > is only getting called ONE time with the correct key and yet it is
| updating
| > TWO records!
| >
| >
| > | > > I am attempting a very straight forward Update on a dataset. I have a
| > > WinForms N-Tier app
| > > using VB.NET.
| > > Visual DataAdapters, typed Datasets.
| > >
| > >
| > > Me.txtHomePhone.DataBindings.Clear()
| > > Me.txtWorkPhone.DataBindings.Clear()
| > > Me.txtPostalCode.DataBindings.Clear()
| > >
| > > 'New field values get assigned
| > > vdsClientUI.ClientByID.Rows(0).Item("PersonHomePhone") =
| > > Me.txtHomePhone.Text
| > > vdsClientUI.ClientByID.Rows(0).Item("PersonWorkPhone") =
| > > Me.txtWorkPhone.Text
| > > vdsClientUI.ClientByID.Rows(0).Item("PersonPostalCode") =
| > > Me.txtPostalCode.Text
| > >
| > > 'passes dataset from the UI through the middle tier to the datalayer
| > > objClient.UpdateClientByID(Me.vdsClientUI, "ClientByID")
| > >
| > > 'At the datalayer update gets applied
| > > Public Overridable Function UpdateClientByID(ByRef vdsClient As
| > > dsClient, ByRef TableName As String)
| > > vdaClientByID.Update(vdsClient, TableName)
| > > End Function
| > >
| > > 'I step through and get a record count of one and yet it updates BOTH
| > > records that exist in this table?
| > >
| > >
| >
| >
|
|
|
 
K

Kevin Yu [MSFT]

Hi Aaron,

I'd like to know if this issue has been resolved. I'm still monitoring on
it.

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

--------------------
| X-Tomcat-ID: 37360571
| References: <[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Kevin Yu [MSFT])
| Organization: Microsoft
| Date: Fri, 31 Oct 2003 01:11:29 GMT
| Subject: Re: Trying to Update ONE record Updates TWO????
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Lines: 75
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:64958
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Aaron,
|
| Please try Colin's suggestion to run it in QA, or try to use SELECT
| statement with the same WHERE condition to see if there're more than one
| records meet the condition.
|
| BTW, did you try my suggestion to call EndEdit() after assigning value to
| it?
|
| Kevin Yu
| =======
| "This posting is provided "AS IS" with no warranties, and confers no
| rights."
|
| --------------------
| | From: "Colin Young" <[email protected]>
| | References: <[email protected]>
| <[email protected]>
| | Subject: Re: Trying to Update ONE record Updates TWO????
| | Date: Thu, 30 Oct 2003 09:31:11 -0500
| | Lines: 51
| | 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.framework.adonet
| | NNTP-Posting-Host: 208.218.199.125
| | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.adonet:64910
| | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| |
| | Post your DDL and the SQL from the trace.
| |
| | What happens if you run the same SQL in QA? Do you get 2 records
updated?
| |
| | Colin
| |
| | | | > As a follow up to this post. I ran a SQL Trace and that Update stored
| proc
| | > is only getting called ONE time with the correct key and yet it is
| | updating
| | > TWO records!
| | >
| | >
| | > | | > > I am attempting a very straight forward Update on a dataset. I have
a
| | > > WinForms N-Tier app
| | > > using VB.NET.
| | > > Visual DataAdapters, typed Datasets.
| | > >
| | > >
| | > > Me.txtHomePhone.DataBindings.Clear()
| | > > Me.txtWorkPhone.DataBindings.Clear()
| | > > Me.txtPostalCode.DataBindings.Clear()
| | > >
| | > > 'New field values get assigned
| | > > vdsClientUI.ClientByID.Rows(0).Item("PersonHomePhone") =
| | > > Me.txtHomePhone.Text
| | > > vdsClientUI.ClientByID.Rows(0).Item("PersonWorkPhone") =
| | > > Me.txtWorkPhone.Text
| | > > vdsClientUI.ClientByID.Rows(0).Item("PersonPostalCode") =
| | > > Me.txtPostalCode.Text
| | > >
| | > > 'passes dataset from the UI through the middle tier to the datalayer
| | > > objClient.UpdateClientByID(Me.vdsClientUI, "ClientByID")
| | > >
| | > > 'At the datalayer update gets applied
| | > > Public Overridable Function UpdateClientByID(ByRef vdsClient As
| | > > dsClient, ByRef TableName As String)
| | > > vdaClientByID.Update(vdsClient, TableName)
| | > > End Function
| | > >
| | > > 'I step through and get a record count of one and yet it updates
BOTH
| | > > records that exist in this table?
| | > >
| | > >
| | >
| | >
| |
| |
| |
|
|
 

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