Change error message duplicate key in ms sql database

in a editable grid view when i add a record with an unique index violation, the error display the technical ms sql message.
I try to use the application messages menu for change the text with
Primary key violation and Unique key violation
but the error message is always the one coming from the database

tks