|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Output SqlParameter + SqlTransactionHello,
I use an output parameter to update identity column in my table after inserting new row and it works fine - identity value is read from the database and written to approprate field in DataRow. However, if I do the inserting inside a transaction and call the Rollback method after that, the identity value is no longer valid and it should be reverted to old value. Do I have to do this manually or is there a way to automate this? I work with Framework v1.1. Thanks. Nik Nik,
DataRow does not participate in a transaction and it will not be automatic. What you could do is to call RejectChanges method for the DataRow and all the data inside of the DataRow will be rolledback Show quote "Nik" <niksa.bal***@gmail.com> wrote in message news:1140641481.546119.116930@f14g2000cwb.googlegroups.com... > Hello, > > I use an output parameter to update identity column in my table after > inserting new row and it works fine - identity value is read from the > database and written to approprate field in DataRow. However, if I do > the inserting inside a transaction and call the Rollback method after > that, the identity value is no longer valid and it should be reverted > to old value. Do I have to do this manually or is there a way to > automate this? > > I work with Framework v1.1. > > Thanks. > > Nik > |
|||||||||||||||||||||||