How do I dig out the Error Number from DataPortalException that is returned from SQL Server?
DataPortalException.BusinessException should get you to the original exception that caused the failure. Most likely that is your SqlException, which would contain everything there is to know about that exception.
If the error number you are looking for isn't directly in the SqlException object then you might need to catch the exception in your DataPortal_XYZ method and wrap it in a custom exception of your own creation that does contain all the information you need. Then throw your custom exception, which would then be available on the client through DataPortalException.BusinessException.
Copyright (c) Marimer LLC