Sub DBGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
Dim TaxTotal As Double
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem,ListItemType.Item
TaxTotal += Cdbl(e.Item.Cells(3).Text)
Case ListItemType.Footer
e.Item.Cells(2).Text = "合计:"
e.Item.Cells(3).Text = TaxTotal
End Select
End Sub
Input string was not in a correct format.
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 116: Select Case e.Item.ItemType
Line 117: Case ListItemType.AlternatingItem,ListItemType.Item
Line 118: TaxTotal = TaxTotal + Cdbl(e.Item.Cells(3).Text)
Line 119:
Line 120: Case ListItemType.Footer
Dim TaxTotal As Double
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem,ListItemType.Item
TaxTotal += Cdbl(e.Item.Cells(3).Text)
Case ListItemType.Footer
e.Item.Cells(2).Text = "合计:"
e.Item.Cells(3).Text = TaxTotal
End Select
End Sub
Input string was not in a correct format.
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 116: Select Case e.Item.ItemType
Line 117: Case ListItemType.AlternatingItem,ListItemType.Item
Line 118: TaxTotal = TaxTotal + Cdbl(e.Item.Cells(3).Text)
Line 119:
Line 120: Case ListItemType.Footer
解决方案 »
- 断点后 少传过来一个值 帮忙来看看
- iis浏览好使 按F5调试就不好使是怎么回事?
- ASP.NET中数据类型转换问题
- 菜鸟入门:WIN2000+ASP.NET怎么配置IIS?在线等
- 新建MSN群 62751 里面 有Aspnet论坛的坛主,Ajax高手,微软的MVP和 国内web标准先驱 阿捷
- DataGrid鼠标移动或移开时颜色变化??
- 一个关于.aspx中内嵌播放器地址动态改变的问题.
- 非常急,明天面试要用的问题,但是我没做过,一下做不出来,请大家多多指教!
- 求助啊各位大哥大姐们,网站做好了,上传到虚拟空间又出现问题
- 树型控件节点的问题
- session应用问题2
- 关于html页面接收和传递参数的问题,请大家帮帮忙了
if (IsNumeric(e.Item.Cells(3).Text))
TaxTotal += Cdbl(e.Item.Cells(3).Text)
Dim TaxTotal As Double
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem,ListItemType.Item
TaxTotal += double.Parse(e.Item.Cells(3).Text);///e.Item.Cells(3).Text是数字不为空
Case ListItemType.Footer
e.Item.Cells(2).Text = "合计:"
e.Item.Cells(3).Text = TaxTotal.toString();//应该转换为STRING型
End Select
End Sub
我的e.Item.Cells(3).Text是空字符(???)但实际上是有数字的,应该怎么写啊??
2 检查给e.Item.Cells(3).Text赋值的语句是否ok
Case ListItemType.Footer
e.Item.Cells(2).Text = "合计:"
e.Item.Cells(3).Text = TaxTotal.ToString最后合计数怎么还是0啊?