Check if Database raises a particular exception
Posted
by mcabral
on Stack Overflow
See other posts from Stack Overflow
or by mcabral
Published on 2010-04-06T18:21:54Z
Indexed on
2010/04/06
18:33 UTC
Read the original article
Hit count: 259
using Nhibernate;
I'm trying to insert several values a on table which has an unique index on some columns.
I'd like to know if a particular insert raises an exception for having violated the unique constraint.
So, which particular exception type should i catch? I only want to catch this particular one and let all others go up.
Thanks a lot!
© Stack Overflow or respective owner