firstdivision
MIS
Hi,
Is there a better way to access the error codes in ASP.NET for a SqlException than:
It seems like there should be a more graceful way to get at the particular SQL error, like SqlError.isKeyViolation or something....
Thanks,
FD
Is there a better way to access the error codes in ASP.NET for a SqlException than:
Code:
Try
'access data class which re-throws the sql error exception if it finds one
Catch sqlerror As SqlException
Select Case sqlerror.Number
Case 2627 'Sql error for key vilation
'display error for key violation
Case Else
'display general SQL error
End Select
Catch ex As Exception
'display general error
End Try
It seems like there should be a more graceful way to get at the particular SQL error, like SqlError.isKeyViolation or something....
Thanks,
FD