6
Reply

How to catch Primary key exception ???

onlybhavin

onlybhavin

Apr 13 2005 2:19 AM
23.9k
Hi, I m faceing problem in catching exception. I m takeing User ID as input in textbox for insert query. Now when i press button save. It throws exception related to primary key. It gives message of its own. but i want to give my own message for it. When primary key constraint violates i want to give message ... " USER ID ALREADY EXIST PROVIDE ANOTHER ID." Is it possible ??? How can i do it ? Same way exception handling for open connection & close conection, I want to give my own message not .net specific. What can i do??? Please guide me step by step. thank u, bhavin gajjar

Answers (6)