USE Transaction in your fron-end, and put the code that saves the data in to database within that transaction scope . It will meet your Requirement.
bool isSuccess=false;
using (TransactionScope transScope = new TransactionScope())
{
if (insertCommand1>0 && insertCommand2>0 && insertCommand3>0)
{
isSuccess = true;
}
}
transScope.Complete();
insertCommand1.Dispose();
insertCommand2.Dispose()
insertCommand3.Dispose()
DataBaseConnection.Dispose();
}
}
catch (TransactionAbortedException ex)
{
MessageBox.Show(ex.Message.ToString(), "Error");
}
catch (ApplicationException ex1)
{
MessageBox.Show(ex1.Message.ToString(), "Error");
}
if (isSuccess == true)
{
MessageBox.Show("Data Saved Successfully", "Success");
}
}