I'm trying to write a statement saying if PD is selected and the difference between date1 and date2 is less than 10, then the amount should equal 100. If it's equal or more than 10, the amount should equal 50. but the error I keep receiving is.....
Server Error in '/FireworksPermitApp' Application.
--------------------------------------------------------------------------------
Procedure 'spInsertTempFWPermitTables' expects parameter '@mAmount', which was not supplied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Procedure 'spInsertTempFWPermitTables' expects parameter '@mAmount', which was not supplied.
I know it's not entering an amount but I don't know how to code it so that the it'll go thru. When I choose the others the amount shows up. But when I choose PD I get this error. Here's my code...
Dim date1, date2, strDateDiff
date1 = txttodaydate.Text
date2 = txtddate.Text
strDateDiff = DateDiff("yyyy", date2, date1)
Dim prmAmount As New SqlParameter("@mAmount", SqlDbType.Money)
If ddlFWClass.SelectedItem.Value = "D" Then
prmAmount.Value = 2000
ElseIf ddlFWClass.SelectedItem.Value = "M" Then
prmAmount.Value = 2000
ElseIf ddlFWClass.SelectedItem.Value = "R" Then
prmAmount.Value = 200
ElseIf ddlFWClass.SelectedItem.Value = "W" Then
prmAmount.Value = 700
ElseIf ddlFWClass.SelectedItem.Value = "SR1" Then
prmAmount.Value = 100
ElseIf ddlFWClass.SelectedItem.Value = "SR2" Then
prmAmount.Value = 200
ElseIf ddlFWClass.SelectedItem.Value = "PD" Then
Else
If strDateDiff < 10 Then
prmAmount.Value = 100
Else
prmAmount.Value = 50
End If
End If
Can someone help me?