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.FormatEx ception: 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(class iDDL.SelectedVa lue)
Line 239: Dim jobAmount As Decimal = Convert.ToDecim al(JobInformati on.GetJobAmt(CI nt(classiDDL.Se lectedValue)))
Line 240: 'Dim jobAmount As Decimal = Convert.ToInt32 (JobInformation .GetJobAmt(clas siDDL.SelectedV alue))
Line 241: Dim reason, message As String
Source File: \\hera\webroot$ \veyo\chits\CCL Chits\CreateCCL Chit.aspx.vb Line: 239
Stack Trace:
[FormatException : Input string was not in a correct format.]
Microsoft.Visua lBasic.Compiler Services.Double Type.Parse(Stri ng Value, NumberFormatInf o NumberFormat) +195
Microsoft.Visua lBasic.Compiler Services.Intege rType.FromStrin g(String Value) +95
[InvalidCastExce ption: Cast from string "" to type 'Integer' is not valid.]
Microsoft.Visua lBasic.Compiler Services.Intege rType.FromStrin g(String Value) +210
veyo.CreateCCLC hit.NextButton1 _Click(Object sender, EventArgs e) in \\hera\webroot$ \veyo\chits\CCL Chits\CreateCCL Chit.aspx.vb:23 9
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +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