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.FormatException: Input string was not in a correct format.
Source Error:
Line 237: Dim validNow As Integer = 1
Line 238: 'Dim jobAmount As Decimal = JobInformation.GetJobAmt(classiDDL.SelectedValue)
Line 239: Dim jobAmount As Decimal = Convert.ToDecimal(JobInformation.GetJobAmt(CInt(cl assiDDL.SelectedValue)))
Line 240: 'Dim jobAmount As Decimal = Convert.ToInt32(JobInformation.GetJobAmt(classiDDL .SelectedValue))
Line 241: Dim reason, message As String
Source File: \\hera\webroot$\veyo\chits\CCLChits\CreateCCLChit. aspx.vb Line: 239
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType. Parse(String Value, NumberFormatInfo NumberFormat) +195
Microsoft.VisualBasic.CompilerServices.IntegerType .FromString(String Value) +95
[InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType .FromString(String Value) +210
veyo.CreateCCLChit.NextButton1_Click(Object sender, EventArgs e) in \\hera\webroot$\veyo\chits\CCLChits\CreateCCLChit. aspx.vb:239
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
here is the code which i am using..............
Expand|Select|Wrap|Line Numbers
- Dim jobAmount As Decimal = Convert.ToDecimal(JobInformation.GetJobAmt(CInt(classiDDL.SelectedValue)))
- If Not chitEdit Then
- ' ==== If only the above is satisfied, continue with the CCL. ====
- If Not transfer Then
- Utilities.CreateMessageAlert(Me, message, "alert")
- Return
- End If
- ' Create CCL chit
- ' -------------------
- Else 'i.e. chitEdit = true
- If Not transfer Then
- Return
- End If
- chitID = CInt(ChitIDLabel.Text)
- If Not Chit.EditChit(chitID, caseID, chitDate, chitSigneeRCN, chitSigneeDesigID, _
- effectiveDate, RemarksAndCC1.ChitRemarks(), CInt(Context.Items("userID"))) Then
- 'Error to user : ERROR in saving edited chit.
- Response.Redirect("/veyo/Error.aspx?eid=21&chitID=" & chitID)
- Return
- End If
- 'JobPanel.Enabled = False
- ' Delete all Havaalaadhey CaseIDs and add new
- If Not DeleteHavaalaadheyCaseIDs(chitID) Then
- Response.Redirect("/veyo/Error.aspx?eid=42&chitID=" & chitID)
- Return
- End If
- If Not SaveHavaalaadheyCaseIDs(caseID, chitID) Then
- Response.Redirect("/veyo/Error.aspx?eid=41&chitID=" & chitID)
- Return
- End If
- ' Delete and Save Chit CC Offices
- If Not DeleteChitCCOffices(chitID) Then
- Response.Redirect("/veyo/Error.aspx?eid=45&chitID=" & chitID)
- Return
- End If
- If Not InsertChitCCOffices(chitID, RemarksAndCC1.GetCCOfficeList) Then
- Response.Redirect("/veyo/Error.aspx?eid=44&chitID=" & chitID)
- Return
- End If
- ' Edit Job History
- If Not JobInformation.UpdateJobHistory(RCN, chitID, effectiveDate, chitDate, _
- BridgeUntilTB.Text, RemarksAndCC1.ChitRemarks, Context.Items("userID")) Then
- Response.Redirect("/veyo/Error.aspx?eid=50&chitID=" & chitID)
- Return
- End If
- ' Delete any Additional Remarks previously written and
- ' check whether there are any additional remarks for original copy and save that
- ' tbl_chitsAdditionalRemarks
- If Not DeleteChitAdditionalRemarks(chitID) Then
- Response.Redirect("/veyo/Error.aspx?eid=47&chitID=" & chitID)
- Return
- End If
- If Not RemarksAndCC1.OriginalCopyChitRemarks = "" Then
- Chit.InsertChitAdditionalRemarks(chitID, RemarksAndCC1.OriginalCopyChitRemarks)
- End If
- Dim pathname As String = Chit.GetDisplayURL(chitType) & "?chitID=" & chitID
- Response.Redirect(pathname)
- End If
- End Sub
- Private Sub ClassDDL_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClassDDL.SelectedIndexChanged
- toSalaryDDL.DataSource = JobInformation.GetClassSalaries(ClassDDL.SelectedValue)
- toSalaryDDL.DataTextField = "salary"
- toSalaryDDL.DataValueField = "classSalID"
- toSalaryDDL.DataBind()
- toSalaryDDL.Enabled = True
- classiDDL.DataSource = JobInformation.GetClassSalaries(ClassDDL.SelectedValue)
- classiDDL.DataTextField = CInt("classID")
- classiDDL.DataValueField = "classSalID"
- 'classiDDL.SelectedValue = Nothing
- classiDDL.DataBind()
- classiDDL.Enabled = True
- End Sub