I'm having a problem in the return "Object can not 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