How do I get a message box to display after the user has entered data into my database via a form?

I know it would something like:

if (condition)

MessageBox.Show("Record Added Successfully");


but im not entirely sure what the condition should look like.

Any help would be greatly appreciated.

I am not too sure what condition you want to check for, but this is how I would do it!

  //my data connection and stuff go here
 //when the data has been updated... I show the message box
catch(exception ex)
  //If an error occurred
  MessageBox.Show("An error occurred: " + ex.message);