Can someone please advise – we want to log a detailed error message to a text file or sql server for any error occurred in .net library which we created.
Try
'Here we are using the sql command object to fetch the required data
Catch ex As Exception
'Here we want to capture detailed error information in a text file or
'sql server
Finally
If Not _SQLCommand Is Nothing Then
_SQLCommand.Dispose()
End If
If Not _Conn Is Nothing Then
_EConn.Close()
End If
End Try
You can try something like this:-