Custom Search

Thursday, October 11, 2007

Database Err Handling

' ----------------------------------------
' Required Imports :
'
' System.Data
' System
' ----------------------------------------

Try
' Add your data task here.
Catch concurrencyEx As DBConcurrencyException
Throw concurrencyEx
Catch constraintEx As ConstraintException
Throw constraintEx
Catch deletedRowEx As DeletedRowInaccessibleException
Throw deletedRowEx
Catch duplicateNameEx As DuplicateNameException
Throw duplicateNameEx
Catch inRowChangingEx As InRowChangingEventException
Throw inRowChangingEx
Catch invalidConstraintEx As InvalidConstraintException
Throw invalidConstraintEx
Catch invalidExpressionEx As InvalidExpressionException
Throw invalidExpressionEx
Catch missingPrimaryEx As MissingPrimaryKeyException
Throw missingPrimaryEx
Catch noNullEx As NoNullAllowedException
Throw noNullEx
Catch readOnlyEx As ReadOnlyException
Throw readOnlyEx
Catch rowNotInTableEx As RowNotInTableException
Throw rowNotInTableEx
Catch strongTypingEx As StrongTypingException
Throw strongTypingEx
Catch typedDataSetEx As TypedDataSetGeneratorException
Throw typedDataSetEx
Catch versionNotFoundEx As VersionNotFoundException
Throw versionNotFoundEx
Catch dataEx As DataException
Throw dataEx
Catch ex As Exception
Throw ex
Finally
' Dispose of any resources you used in the Try block.
End Try

No comments: