You're just creating a new DialogResult and ignoring the click from the dialog. Instead you need to get the DialogResult from the MessageBox
String msg = "Number of records affected:" + numberOfRecordsroll + " Please check the data is correct before proceeding:";
DialogResult dr = MessageBox.Show(msg, "Please validate your changes", MessageBoxButtons.OKCancel);