However, the generated update cannot be used with transaction.
I have tried using transaction scope <-- not succeed
I have tried to follow the approach:
http://weblogs.asp.net/ryanw/archive/2006/03/30/441529.aspx
the following error return:
System.InvalidOperationException: ExecuteReader requires the command to have
a transaction when the connection assigned to the command is in a pending
local transaction. The Transaction property of the command has not been
initialized.
Please help as I am sticking with this problematic update because it is not
transactional. Thanks.
I am sorry that what I meant is tableAdapter but not sqldataadapter.
In the visual studio 2005, you can right click the App_code folder and then
new dataset.
There is methods of Insert/Update/Delete which you can customise, and they
are all inside the tableadapter of the dataset. My problem is such method of
insert/update/delete cannot be inside the transaction.
Thanks.
Thomas
I have solved the problem.
The table adapter can use the following command to get the dataadapter:
adapter = CType(type.GetProperty("Adapter", BindingFlags.NonPublic Or
BindingFlags.Instance).GetValue(tableAdapter, Nothing), SqlDataAdapter)
then I change the command 's transaction to be a specific transaction
adapter.UpdateCommand.Transaction = transaction
Thanks anyway