Okay, as I understand this here is an example of where you can 'Trap' your error during a fictional 'Update' procedure. During the update procedure if something weird happens then it will resolve here within this function call.
From that point I can choose to deal with the error. Here I simply show a message box.
''' <summary>
''' Updates a record in the <c>Issues</c> table.
''' </summary>
''' <param name="value">The <see cref="IssuesRow"/>
''' <summary>
''' Updates a record in the <c>Issues</c> table.
''' </summary>
''' <param name="value">The <see cref="IssuesRow"/>
''' object used to update the table record.</param>
''' <returns>true if the record was updated; otherwise, false.</returns>
Public Overridable Function Update(value As IssuesRow) As Boolean
try
Dim sqlStr As String = "UPDATE [Issues] SET " + _
"[ProjectID]=" + _db.CreateSqlParameterName("ProjectID") + ", " + _
"[Title]=" + _db.CreateSqlParameterName("Title") + ", " + _
"[Status]=" + _db.CreateSqlParameterName("Status") + ", " + _
"[Severity]=" + _db.CreateSqlParameterName("Severity") + ", " + _
"[DateFound]=" + _db.CreateSqlParameterName("DateFound") + _
" WHERE " + _
"[IssueID]=" + _db.CreateSqlParameterName("IssueID")
Dim cmd As IDbCommand = _db.CreateCommand(sqlStr)
If value.IsProjectIDNull Then
AddParameter(cmd, "ProjectID", DBNull.Value)
Else
AddParameter(cmd, "ProjectID", value.ProjectID)
End If
AddParameter(cmd, "Title", value.Title)
AddParameter(cmd, "Status", value.Status)
AddParameter(cmd, "Severity", value.Severity)
AddParameter(cmd, "DateFound", value.DateFound)
AddParameter(cmd, "IssueID", value.IssueID)
Return 0 <> cmd.ExecuteNonQuery()
Catch ex as Exception
' Show the error that occured
msgbox( "The following error has ocurred: " & ex.message )
End try
End Function