now the system always prompts a error message about insert duplicate key into Sybase database.
how can i prompt a message box instead of this error message when i insert duplicate key into sybase database table. any code can check what type of error then prompt different alert message.
Member
54 Points
1286 Posts
insert duplicate key into Sybase db table [help]
Jun 22, 2010 11:39 AM|-_-|LINK
now the system always prompts a error message about insert duplicate key into Sybase database.
how can i prompt a message box instead of this error message when i insert duplicate key into sybase database table. any code can check what type of error then prompt different alert message.
please help, thanks.
All-Star
120146 Points
27989 Posts
Moderator
MVP
Re: insert duplicate key into Sybase db table [help]
Jun 22, 2010 12:16 PM|ignatandrei|LINK
try
{
//code
}
catch(Type of exception ex)
{
//check if sybase exceptions have a number to identify duplicate key
if(ex.Number == duplicate key number)
{
//custom message for duplicate
//add to page javascript a window.confirm
//or add to valiation summary
// or other data
}
else
{
//generic message
//add to page javascript a window.confirm
//or add to valiation summary
// or other data
}