Re: DataAdapter.Update

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Am I possibly going to get a solution to this problem any time soon?
--
Erol


"Erol" wrote:

Hi,

Any ideas?
--
Erol


"Erol" wrote:

Yes it is mapped to a column
--
Erol


"W.G. Ryan [MVP]" wrote:

Is the param mapped to a column or something?
"Erol" <Erol@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0FD44D8A-0C6C-4CFA-8DA3-4AF466C64D8E@xxxxxxxxxxxxxxxx
Thanks for your quick response. I've tested it using your recommendation
and
it works fine, but I have an ouput parameter in the stored procedure and
that
parameter seems to change the row state to 'Modified' instead of 'Added'.

How do get the row to remain in the 'Added' state when the stored
procedure
returns an error?

--
Erol


"W.G. Ryan [MVP]" wrote:

Update calls AcceptChanges on each row as it updates them. If you're
using
the 2.0 Framework (or 3.0), just set the AcceptChangesDuringUpdate to
false - then *after* update, when you know everything is kosher, call
AcceptChanges on the entire datatable.

If you're using an earlier version, you can use a new dataset =
OldDataSet.GetChanges();

Then, call Update on the *new* dataset. If it's successful, call
AcceptChanges on the *old* dataset and you're done. If it's not
successful,
you're rowstate is fine.
"Erol" <Erol@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0FC69A32-9262-48C5-BBDA-4BE41483146E@xxxxxxxxxxxxxxxx
I've got two rows added to my datatable that I need to commit to the
database. I begin a transaction on my connection and attempt to update
both
rows as one transaction to the database.

My first record is successful, but my second row fails due to a
business
logic error raised in the stored procedure. The transaction, therefore
gets
rolled back and neither record gets commited to the database (perfect).

My first successful row has now changed status from "Added" to
"Unchanged"(why). So, now I rectify my second row in order to rectify
the
business logic error and my second row has remained as an "Added" row
(perfect).

Now I begin the transaction and only my second row gets commited to the
database and not my first, as it's status changed to "Unchanged".

How does one go about solving this issue, as one would expect both rows
to
remain in the "Added" state, so that both rows can be commited to the
database?

--
Erol






.



Relevant Pages

  • Re: DataAdapter.Update
    ... I begin a transaction on my connection and attempt to update ... rows as one transaction to the database. ... logic error raised in the stored procedure. ... now I rectify my second row in order to rectify ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataAdapter.Update
    ... I begin a transaction on my connection and attempt to update ... rows as one transaction to the database. ... logic error raised in the stored procedure. ... now I rectify my second row in order to rectify ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataAdapter.Update
    ... I begin a transaction on my connection and attempt to update ... rows as one transaction to the database. ... logic error raised in the stored procedure. ... now I rectify my second row in order to rectify ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataAdapter.Update
    ... Update calls AcceptChanges on each row as it updates them. ... I begin a transaction on my connection and attempt to update ... rows as one transaction to the database. ... but my second row fails due to a business ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: TypedDatasets and Transaction
    ... You should be doing database operations on DataSet.GetChangesdataset ... If changes are successful you should do Merge to the orginal one. ... > I have a transaction that adds a row in two tables. ... respectively after adding the rwo to the dataset, to update the database. ...
    (microsoft.public.dotnet.framework.adonet)