代码之家  ›  专栏  ›  技术社区  ›  SidC

算术运算导致ASP.NET 2.0 VB溢出

  •  1
  • SidC  · 技术社区  · 15 年前

    我正在使用以下代码:

    If chkApproximately.Checked Then
    '.Item_Title = "~ " & String.Format("{0:N0}", Int32.Parse(Me.txtQuantity.Text)) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim  'txtItem_Title.Text.Trim
    .Item_Title = "~ " & String.Format("{0:N0}", Me.txtQuantity.Text) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim  'txtItem_Title.Text.Trim
    Else
    .Item_Title = String.Format("{0:N0}", Me.txtQuantity.Text) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim 'txtItem_Title.Text.Trim
    End If
    

    当我在Web服务器上运行ASPX页面、提供值并提交表单时,我会收到问题头中所述的错误消息。有人能解释为什么会发生这种情况并提供一些建议的解决方案吗?

    谢谢, 希德

    1 回复  |  直到 15 年前
        1
  •  0
  •   Jey Geethan    15 年前

    猜测。尝试“+”而不是“&”

    推荐文章