F
Francois Malgreve
Hi,
I am using SQLTransaction.
I just wonder if it is possible to use the same transaction over multiple
command object.
I would like to have 3 commands object in my code (3 inserts or updates) and
put them in the same transactions.
Somehow in the .NET framework reference, it is using a single Command object
and changing it's CommandText property like in the following exemple.
(...)
myCommand.CommandText = "Insert into Region (RegionID, RegionDescription)
VALUES (100, 'Description')";
myCommand.ExecuteNonQuery();
myCommand.CommandText = "Insert into Region (RegionID, RegionDescription)
VALUES (101, 'Description')";
myCommand.ExecuteNonQuery();
myTrans.Commit();
(...)
This hardcoded way to do is unacceptable as my paramters values are set at
run time and not at compile time.
Any hint? or any link to some guidelines or articles about this?
thank you
francois
I am using SQLTransaction.
I just wonder if it is possible to use the same transaction over multiple
command object.
I would like to have 3 commands object in my code (3 inserts or updates) and
put them in the same transactions.
Somehow in the .NET framework reference, it is using a single Command object
and changing it's CommandText property like in the following exemple.
(...)
myCommand.CommandText = "Insert into Region (RegionID, RegionDescription)
VALUES (100, 'Description')";
myCommand.ExecuteNonQuery();
myCommand.CommandText = "Insert into Region (RegionID, RegionDescription)
VALUES (101, 'Description')";
myCommand.ExecuteNonQuery();
myTrans.Commit();
(...)
This hardcoded way to do is unacceptable as my paramters values are set at
run time and not at compile time.
Any hint? or any link to some guidelines or articles about this?
thank you
francois