Hello,
I want to give transaction support with Commands
generated by OledbCommandBuilder, can anybody tell me how to do that.

Regards,
Devdatta

Re: Transaction with oledbCommandBuilder by William

William
Wed Sep 17 08:28:26 CDT 2003

Right before you fire update, begin a transaction.

Dim tra as SqlTransaction

tra = myConnection.BeginTransaction


then, fire your update or whatever,

Make sure it's wrapped in a Try catch block. The next line after update
should be Transaction.Commit.

In your exception block, use Transaction.Rollback.

HTH

Bill
"Devdatta" <devdatta.kulkarni@emantratech.com> wrote in message
news:uYCtVVPfDHA.1888@TK2MSFTNGP12.phx.gbl...
> Hello,
> I want to give transaction support with Commands
> generated by OledbCommandBuilder, can anybody tell me how to do that.
>
> Regards,
> Devdatta
>
>



Re: Transaction with oledbCommandBuilder by Angel

Angel
Wed Sep 24 17:00:37 CDT 2003

The problem here is that there is a known bug with the CommandBuilder and
transactions, if you try to deriveparameters on a command while a
transaction is active you will get the error that indicates that you need to
associate the transaction to the command.

The workarround is to open a fresh connection that you can assign to the
command, derive parameters using the new connection, and then associate the
command to the connection that is using the transaction that you want to run
under.

Sorry about that,
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"William Ryan" <dotnetguru@comcast.nospam.net> wrote in message
news:OteO#8RfDHA.944@TK2MSFTNGP11.phx.gbl...
> Right before you fire update, begin a transaction.
>
> Dim tra as SqlTransaction
>
> tra = myConnection.BeginTransaction
>
>
> then, fire your update or whatever,
>
> Make sure it's wrapped in a Try catch block. The next line after update
> should be Transaction.Commit.
>
> In your exception block, use Transaction.Rollback.
>
> HTH
>
> Bill
> "Devdatta" <devdatta.kulkarni@emantratech.com> wrote in message
> news:uYCtVVPfDHA.1888@TK2MSFTNGP12.phx.gbl...
> > Hello,
> > I want to give transaction support with Commands
> > generated by OledbCommandBuilder, can anybody tell me how to do that.
> >
> > Regards,
> > Devdatta
> >
> >
>
>