Friday, August 16, 2013

Unique Key Violation in SQL Server

if (ThisSqlException.Number == 2627)
{
    // Handle unique constraint violation.
}
else
{
    // Handle the remaing errors.
}