Looping through dataset and updating - getting error

I tried that, but get the error message:

Error: BC30456 - line 405 (5899) - 'Update' is not a member of
'System.Data.DataRow'.







From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
zanniebelle
Sent: Monday, January 24, 2011 7:47 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Looping through dataset and updating - getting error





I never have used "otrans.update()"...if only the detail row is being
modified, I would do DtlDR.Update() (along with the BeginEdit/EndEdit
mentioned below).

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Kevin
Simon" <ksimon@...> wrote:
>
> Joe,
>
>
>
> Thanks for the direction. I wrapped the updates in a BeginEdit and
EndEdit,
> and it seems to have helped the problem, but I'm not quite there yet.
>
>
>
> Here's what I find. If I'm on the order header (click into a order header
> field, notice that the tree view is on the order header) and invoke the
> button that kicks off this process, I get one display of "do you want to
> save your changes", then I continue to get the "Order Header has not
> changed" message on each line it is updating. Again, it is performing the
> update, just warning me about the Order Header.
>
>
>
> However, if I go to the lines tab and set my focus there (again, verified
by
> the tree view now being on a line), then click the button to invoke the
code
> - I get none of the intermediate error messages.
>
>
>
> Kevin
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
> Joe Rojas
> Sent: Sunday, January 23, 2011 9:10 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: RE: [Vantage] Re: Looping through dataset and updating - getting
> error
>
>
>
>
>
> Have you tried wrapping the update to the field in .BeginEdit and
> .EndEdit?
>
> As for why you cannot update multiple rows before the .Update(), it's
> because the Epicor dataset only allows one dirty row.
>
> So your conclusion is correct, that you need to trigger .Update() for
> each row.
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
> Behalf
> Of Kevin Simon
> Sent: Sunday, January 23, 2011 6:38 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> Subject: RE: [Vantage] Re: Looping through dataset and updating -
> getting error
>
> It sounds as if that's what it's doing. How do I change the focus of
> otrans?
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ] On
> Behalf Of
> bw2868bond
> Sent: Saturday, January 22, 2011 8:23 AM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Re: Looping through dataset and updating - getting
> error
>
> Look in the tree view while your code executes and see if the focus is
> on
> the header
>
> or
>
> while your code executes are you on the detail tab on the form...
>
> oTrans thinks that the header data is the data being worked on.....
>
> (just a WAG)
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ,
> "ksimon8fw" <ksimon@> wrote:
> >
> > I've got a situation where I've got a sales order up, and I am looping
> through each row of the detail and updating a field. It appears I have
> to do
> an update after each detail record, or when I do an update at the end,
> it
> only modifies the first record.
> >
> > However, although the code works, I'm getting a save confirmation, and
> an
> error message on each detail record, saying that the "Order Header has
> not
> changed". Anybody have any idea why the code seems to think it's
> updating a
> header?
> >
> > Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
> EpiDataView)
> > for each DtlDR as datarow in edvd.dataview.Table.rows
> > DtlDR("DiscountPercent") = 50
> > otrans.update()
> > next
> >
> > I've got some other code in there where I'm going against a UD table
> to
> get the actual percentage of the update, but I stripped that out since
> it's
> not relavent here.
> >
> > Thanks!
> >
> > Kevin Simon
> >
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]
I've got a situation where I've got a sales order up, and I am looping through each row of the detail and updating a field. It appears I have to do an update after each detail record, or when I do an update at the end, it only modifies the first record.

However, although the code works, I'm getting a save confirmation, and an error message on each detail record, saying that the "Order Header has not changed". Anybody have any idea why the code seems to think it's updating a header?

Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"), EpiDataView)
for each DtlDR as datarow in edvd.dataview.Table.rows
DtlDR("DiscountPercent") = 50
otrans.update()
next

I've got some other code in there where I'm going against a UD table to get the actual percentage of the update, but I stripped that out since it's not relavent here.

Thanks!

Kevin Simon
Look in the tree view while your code executes and see if the focus is on the header

or

while your code executes are you on the detail tab on the form...

oTrans thinks that the header data is the data being worked on.....

(just a WAG)

--- In vantage@yahoogroups.com, "ksimon8fw" <ksimon@...> wrote:
>
> I've got a situation where I've got a sales order up, and I am looping through each row of the detail and updating a field. It appears I have to do an update after each detail record, or when I do an update at the end, it only modifies the first record.
>
> However, although the code works, I'm getting a save confirmation, and an error message on each detail record, saying that the "Order Header has not changed". Anybody have any idea why the code seems to think it's updating a header?
>
> Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"), EpiDataView)
> for each DtlDR as datarow in edvd.dataview.Table.rows
> DtlDR("DiscountPercent") = 50
> otrans.update()
> next
>
> I've got some other code in there where I'm going against a UD table to get the actual percentage of the update, but I stripped that out since it's not relavent here.
>
> Thanks!
>
> Kevin Simon
>
It sounds as if that's what it's doing. How do I change the focus of
otrans?



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
bw2868bond
Sent: Saturday, January 22, 2011 8:23 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Looping through dataset and updating - getting error





Look in the tree view while your code executes and see if the focus is on
the header

or

while your code executes are you on the detail tab on the form...

oTrans thinks that the header data is the data being worked on.....

(just a WAG)

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"ksimon8fw" <ksimon@...> wrote:
>
> I've got a situation where I've got a sales order up, and I am looping
through each row of the detail and updating a field. It appears I have to do
an update after each detail record, or when I do an update at the end, it
only modifies the first record.
>
> However, although the code works, I'm getting a save confirmation, and an
error message on each detail record, saying that the "Order Header has not
changed". Anybody have any idea why the code seems to think it's updating a
header?
>
> Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
EpiDataView)
> for each DtlDR as datarow in edvd.dataview.Table.rows
> DtlDR("DiscountPercent") = 50
> otrans.update()
> next
>
> I've got some other code in there where I'm going against a UD table to
get the actual percentage of the update, but I stripped that out since it's
not relavent here.
>
> Thanks!
>
> Kevin Simon
>





[Non-text portions of this message have been removed]
Have you tried wrapping the update to the field in .BeginEdit and
.EndEdit?

As for why you cannot update multiple rows before the .Update(), it's
because the Epicor dataset only allows one dirty row.

So your conclusion is correct, that you need to trigger .Update() for
each row.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Kevin Simon
Sent: Sunday, January 23, 2011 6:38 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: Looping through dataset and updating -
getting error





It sounds as if that's what it's doing. How do I change the focus of
otrans?

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
bw2868bond
Sent: Saturday, January 22, 2011 8:23 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Re: Looping through dataset and updating - getting
error

Look in the tree view while your code executes and see if the focus is
on
the header

or

while your code executes are you on the detail tab on the form...

oTrans thinks that the header data is the data being worked on.....

(just a WAG)

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
"ksimon8fw" <ksimon@...> wrote:
>
> I've got a situation where I've got a sales order up, and I am looping
through each row of the detail and updating a field. It appears I have
to do
an update after each detail record, or when I do an update at the end,
it
only modifies the first record.
>
> However, although the code works, I'm getting a save confirmation, and
an
error message on each detail record, saying that the "Order Header has
not
changed". Anybody have any idea why the code seems to think it's
updating a
header?
>
> Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
EpiDataView)
> for each DtlDR as datarow in edvd.dataview.Table.rows
> DtlDR("DiscountPercent") = 50
> otrans.update()
> next
>
> I've got some other code in there where I'm going against a UD table
to
get the actual percentage of the update, but I stripped that out since
it's
not relavent here.
>
> Thanks!
>
> Kevin Simon
>

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]
Joe,



Thanks for the direction. I wrapped the updates in a BeginEdit and EndEdit,
and it seems to have helped the problem, but I'm not quite there yet.



Here's what I find. If I'm on the order header (click into a order header
field, notice that the tree view is on the order header) and invoke the
button that kicks off this process, I get one display of "do you want to
save your changes", then I continue to get the "Order Header has not
changed" message on each line it is updating. Again, it is performing the
update, just warning me about the Order Header.



However, if I go to the lines tab and set my focus there (again, verified by
the tree view now being on a line), then click the button to invoke the code
- I get none of the intermediate error messages.



Kevin



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Joe Rojas
Sent: Sunday, January 23, 2011 9:10 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: Looping through dataset and updating - getting
error





Have you tried wrapping the update to the field in .BeginEdit and
.EndEdit?

As for why you cannot update multiple rows before the .Update(), it's
because the Epicor dataset only allows one dirty row.

So your conclusion is correct, that you need to trigger .Update() for
each row.

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Kevin Simon
Sent: Sunday, January 23, 2011 6:38 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Re: Looping through dataset and updating -
getting error

It sounds as if that's what it's doing. How do I change the focus of
otrans?

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf Of
bw2868bond
Sent: Saturday, January 22, 2011 8:23 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Re: Looping through dataset and updating - getting
error

Look in the tree view while your code executes and see if the focus is
on
the header

or

while your code executes are you on the detail tab on the form...

oTrans thinks that the header data is the data being worked on.....

(just a WAG)

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
"ksimon8fw" <ksimon@...> wrote:
>
> I've got a situation where I've got a sales order up, and I am looping
through each row of the detail and updating a field. It appears I have
to do
an update after each detail record, or when I do an update at the end,
it
only modifies the first record.
>
> However, although the code works, I'm getting a save confirmation, and
an
error message on each detail record, saying that the "Order Header has
not
changed". Anybody have any idea why the code seems to think it's
updating a
header?
>
> Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
EpiDataView)
> for each DtlDR as datarow in edvd.dataview.Table.rows
> DtlDR("DiscountPercent") = 50
> otrans.update()
> next
>
> I've got some other code in there where I'm going against a UD table
to
get the actual percentage of the update, but I stripped that out since
it's
not relavent here.
>
> Thanks!
>
> Kevin Simon
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
I never have used "otrans.update()"...if only the detail row is being modified, I would do DtlDR.Update() (along with the BeginEdit/EndEdit mentioned below).



--- In vantage@yahoogroups.com, "Kevin Simon" <ksimon@...> wrote:
>
> Joe,
>
>
>
> Thanks for the direction. I wrapped the updates in a BeginEdit and EndEdit,
> and it seems to have helped the problem, but I'm not quite there yet.
>
>
>
> Here's what I find. If I'm on the order header (click into a order header
> field, notice that the tree view is on the order header) and invoke the
> button that kicks off this process, I get one display of "do you want to
> save your changes", then I continue to get the "Order Header has not
> changed" message on each line it is updating. Again, it is performing the
> update, just warning me about the Order Header.
>
>
>
> However, if I go to the lines tab and set my focus there (again, verified by
> the tree view now being on a line), then click the button to invoke the code
> - I get none of the intermediate error messages.
>
>
>
> Kevin
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> Joe Rojas
> Sent: Sunday, January 23, 2011 9:10 PM
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] Re: Looping through dataset and updating - getting
> error
>
>
>
>
>
> Have you tried wrapping the update to the field in .BeginEdit and
> .EndEdit?
>
> As for why you cannot update multiple rows before the .Update(), it's
> because the Epicor dataset only allows one dirty row.
>
> So your conclusion is correct, that you need to trigger .Update() for
> each row.
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> Behalf
> Of Kevin Simon
> Sent: Sunday, January 23, 2011 6:38 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: RE: [Vantage] Re: Looping through dataset and updating -
> getting error
>
> It sounds as if that's what it's doing. How do I change the focus of
> otrans?
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ] On
> Behalf Of
> bw2868bond
> Sent: Saturday, January 22, 2011 8:23 AM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Re: Looping through dataset and updating - getting
> error
>
> Look in the tree view while your code executes and see if the focus is
> on
> the header
>
> or
>
> while your code executes are you on the detail tab on the form...
>
> oTrans thinks that the header data is the data being worked on.....
>
> (just a WAG)
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com>
> <mailto:vantage%40yahoogroups.com> ,
> "ksimon8fw" <ksimon@> wrote:
> >
> > I've got a situation where I've got a sales order up, and I am looping
> through each row of the detail and updating a field. It appears I have
> to do
> an update after each detail record, or when I do an update at the end,
> it
> only modifies the first record.
> >
> > However, although the code works, I'm getting a save confirmation, and
> an
> error message on each detail record, saying that the "Order Header has
> not
> changed". Anybody have any idea why the code seems to think it's
> updating a
> header?
> >
> > Dim edvD As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),
> EpiDataView)
> > for each DtlDR as datarow in edvd.dataview.Table.rows
> > DtlDR("DiscountPercent") = 50
> > otrans.update()
> > next
> >
> > I've got some other code in there where I'm going against a UD table
> to
> get the actual percentage of the update, but I stripped that out since
> it's
> not relavent here.
> >
> > Thanks!
> >
> > Kevin Simon
> >
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> [Non-text portions of this message have been removed]
>