1
I’m having a problem with Return "Object cannot be cast from Dbnull to other types", how to proceed?
Public Function RetornaValorTotalPremiacao(ByVal strCodigoProposta As String) As Decimal
Try
Dim objApoioConexao As New ApoioConexao
objApoioConexao.AdicionaParametro(strCodigoProposta, "@CD_PROP")
Return Convert.ToDecimal(objDMConexao.ExecutaComando(My.Settings.ConexaoAtiva, "[dbo].[usp_sel_valor_total_premiacao]", CommandType.StoredProcedure, objApoioConexao.RetornaArrayParametros))
Catch ex As Exception
Throw
End Try
End Function
Solved ISNULL(SUM(PRO.VALOR_CUSTA),0)!
– WellDotCom
Poses as answer to help next humans with the same problem.
– PauloHDSousa