R
REB
If I create a transaction object for rolling back a insert query in the on
click event of a form button can the transaction be tracked across other
functions?
For example:
private void btnSaveDriver_Click(object sender, System.EventArgs e)
{
Create transaction object
Execute a insert query into a primary table
Call_Funtion_One(int primary_key_from_intial_insert)
Call_Funtion_Two(int Primarykey)
on error rollback everything exectued above
}
Call_Funtion_One(int Primarykey)
{
Execute query to insert data in a related table using key passed into the
function
}
Call_Funtion_Two(int Primarykey)
{
Execute query to insert data in a related table using key passed into the
function
}
I hope what I am asking makes sense, if not please let me know and I will
try to elaborate further.
click event of a form button can the transaction be tracked across other
functions?
For example:
private void btnSaveDriver_Click(object sender, System.EventArgs e)
{
Create transaction object
Execute a insert query into a primary table
Call_Funtion_One(int primary_key_from_intial_insert)
Call_Funtion_Two(int Primarykey)
on error rollback everything exectued above
}
Call_Funtion_One(int Primarykey)
{
Execute query to insert data in a related table using key passed into the
function
}
Call_Funtion_Two(int Primarykey)
{
Execute query to insert data in a related table using key passed into the
function
}
I hope what I am asking makes sense, if not please let me know and I will
try to elaborate further.