Question : Return message from class

In my attached code...which is part of a dll that gets compiled...is there a way to return a True, True where the process succeeds and salesrate =>0 and true,False where it succeeds and the salesrate < 0 ??
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Public Function SaveDataFromTValue() As Boolean
        '--first we save the individual payments
        SavePayments()

        'next we save the newly calculated values
        Dim strCommand As String = "sp_research_DealSaveDataFromTValue"  'sp_p_deal_SaveDataFromTValue"
        If DealType = CFDealType.Lottery Then
            strCommand = "sp_lotto_DealSaveDataFromTValue"
        End If
        Dim oCon = GetDBConnection("ConnPortal")
        Dim oCmd As New SqlCommand(strCommand, oCon)

        oCmd.CommandType = CommandType.StoredProcedure
        oCmd.Parameters.Clear()
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@DealID", System.Data.SqlDbType.Int)).Value = DealID
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@LoanDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(LoanDate)
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@FirstPmtDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(FirstPmtDate)
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@LastPmtDate", System.Data.SqlDbType.DateTime)).Value = SetDBDate(LastPmtDate)
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@FedPV", System.Data.SqlDbType.Money)).Value = FedPV
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@salesRate", System.Data.SqlDbType.Float)).Value = salesRate
        oCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SRAmt", System.Data.SqlDbType.Money)).Value = salesAmt
        oCon.Open()
        oCmd.ExecuteNonQuery()
        oCmd.Dispose()
        oCmd = Nothing
        oCon.Close()
        oCon = Nothing
        Return True
    End Function

Answer : Return message from class

Try using vlookup or hlookup excel functions


Both can lookup for a value in a column and return a cell value.


Random Solutions  
 
programming4us programming4us