i have set a message box button yes/no. i want when i click on button yes then save the value in database and when i click on no then donot save.

if (DialogResult.Yes == MessageBox.Show("Do you want to save into a database?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {

                //SAVE into database
            }
            else
            { 
            //not saving! then you dont even need this else (you can erase it if you dont need it
            }