469,913 Members | 2,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

Input string in incorrect form..Help needed urgently!!

have got an error which says Input string was not in a correct format. as follows..

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
  1.  Dim jobAmount As Decimal = Convert.ToDecimal(JobInformation.GetJobAmt(CInt(classiDDL.SelectedValue)))
  2.  
  3.         If Not chitEdit Then
  4.             ' ====  If only the above is satisfied, continue with the CCL. ====
  5.             If Not transfer Then
  6.                 Utilities.CreateMessageAlert(Me, message, "alert")
  7.                 Return
  8.             End If
  9.  
  10.             ' Create CCL chit
  11.             ' -------------------
  12.  
  13.  
  14.         Else 'i.e. chitEdit = true
  15.  
  16.             If Not transfer Then
  17.                 Return
  18.             End If
  19.  
  20.             chitID = CInt(ChitIDLabel.Text)
  21.  
  22.             If Not Chit.EditChit(chitID, caseID, chitDate, chitSigneeRCN, chitSigneeDesigID, _
  23.                     effectiveDate, RemarksAndCC1.ChitRemarks(), CInt(Context.Items("userID"))) Then
  24.                 'Error to user : ERROR in saving edited chit.
  25.                 Response.Redirect("/veyo/Error.aspx?eid=21&chitID=" & chitID)
  26.                 Return
  27.             End If
  28.  
  29.  
  30.             'JobPanel.Enabled = False
  31.  
  32.  
  33.  
  34.             ' Delete all Havaalaadhey CaseIDs and add new
  35.             If Not DeleteHavaalaadheyCaseIDs(chitID) Then
  36.                 Response.Redirect("/veyo/Error.aspx?eid=42&chitID=" & chitID)
  37.                 Return
  38.             End If
  39.  
  40.             If Not SaveHavaalaadheyCaseIDs(caseID, chitID) Then
  41.                 Response.Redirect("/veyo/Error.aspx?eid=41&chitID=" & chitID)
  42.                 Return
  43.             End If
  44.  
  45.             ' Delete and Save Chit CC Offices
  46.             If Not DeleteChitCCOffices(chitID) Then
  47.                 Response.Redirect("/veyo/Error.aspx?eid=45&chitID=" & chitID)
  48.                 Return
  49.             End If
  50.  
  51.             If Not InsertChitCCOffices(chitID, RemarksAndCC1.GetCCOfficeList) Then
  52.                 Response.Redirect("/veyo/Error.aspx?eid=44&chitID=" & chitID)
  53.                 Return
  54.             End If
  55.  
  56.  
  57.             ' Edit Job History
  58.             If Not JobInformation.UpdateJobHistory(RCN, chitID, effectiveDate, chitDate, _
  59.                 BridgeUntilTB.Text, RemarksAndCC1.ChitRemarks, Context.Items("userID")) Then
  60.                 Response.Redirect("/veyo/Error.aspx?eid=50&chitID=" & chitID)
  61.                 Return
  62.             End If
  63.  
  64.             ' Delete any Additional Remarks previously written and
  65.             ' check whether there are any additional remarks for original copy and save that
  66.             ' tbl_chitsAdditionalRemarks
  67.             If Not DeleteChitAdditionalRemarks(chitID) Then
  68.                 Response.Redirect("/veyo/Error.aspx?eid=47&chitID=" & chitID)
  69.                 Return
  70.             End If
  71.  
  72.             If Not RemarksAndCC1.OriginalCopyChitRemarks = "" Then
  73.                 Chit.InsertChitAdditionalRemarks(chitID, RemarksAndCC1.OriginalCopyChitRemarks)
  74.             End If
  75.  
  76.             Dim pathname As String = Chit.GetDisplayURL(chitType) & "?chitID=" & chitID
  77.             Response.Redirect(pathname)
  78.  
  79.  
  80.         End If
  81.  
  82.     End Sub
  83.  
  84.     Private Sub ClassDDL_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClassDDL.SelectedIndexChanged
  85.         toSalaryDDL.DataSource = JobInformation.GetClassSalaries(ClassDDL.SelectedValue)
  86.         toSalaryDDL.DataTextField = "salary"
  87.         toSalaryDDL.DataValueField = "classSalID"
  88.         toSalaryDDL.DataBind()
  89.         toSalaryDDL.Enabled = True
  90.  
  91.         classiDDL.DataSource = JobInformation.GetClassSalaries(ClassDDL.SelectedValue)
  92.         classiDDL.DataTextField = CInt("classID")
  93.         classiDDL.DataValueField = "classSalID"
  94.         'classiDDL.SelectedValue = Nothing
  95.         classiDDL.DataBind()
  96.         classiDDL.Enabled = True
  97.  
  98.     End Sub 
Sep 14 '06 #1
0 2307

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Tom | last post: by
reply views Thread by Kamliesh Nadar | last post: by
reply views Thread by Amit | last post: by
2 posts views Thread by walterd | last post: by
3 posts views Thread by gauravkg via DotNetMonster.com | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.