what you have will not work because you are adding the onclick event after the button was already clicked. so after the page postsback you should get that alert when you press the button using your code.
use this.
if (drff.Read())
{
ClientScript.RegisterStartupScript(typeof(string), "success", "alert('Data saved successfully.');", true);
}
else
{
ClientScript.RegisterStartupScript(typeof(string), "fail", "alert('Data not saved.');", true);
}
this adds the alert to the page load, which is the place you want to add it.