//query
int a = cmd.ExecuteNonQuery();
If(a>0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "message",
"alert('Data Inserted Successfully');", true);
}
else
{
ScriptManager.RegisterStartupScript(this, GetType(), "message",
"alert('Error');", true);
}