How to catch SQL Exception?
-
Hi, When I ty to delete a record from application, the SQL Server throws following exception: "DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_tblPromotion_tblCategory'. The conflict occurred in database 'match', table 'tblPromotion', column 'Categorym_id'" I want to catch this exception gracefully but I don't see any exception code. How can I catch this SQL exception? Please suggest. Thanks Pankaj Follow your goals, Means will follow you ---Gandhi---
-
Hi, When I ty to delete a record from application, the SQL Server throws following exception: "DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_tblPromotion_tblCategory'. The conflict occurred in database 'match', table 'tblPromotion', column 'Categorym_id'" I want to catch this exception gracefully but I don't see any exception code. How can I catch this SQL exception? Please suggest. Thanks Pankaj Follow your goals, Means will follow you ---Gandhi---
Use Try Catch End Try Look into sqlException..something like this i tthink Try ..your delete here catch e as SQLException ...alert user or write to log file end try But do look into SQLException.