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!

try
{
  //my data connection and stuff go here
 //when the data has been updated... I show the message box
 MessageBox.Show("Success!");
}
catch(exception ex)
{
  //If an error occurred
  MessageBox.Show("An error occurred: " + ex.message);
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.