【发布时间】:2011-10-20 14:09:16
【问题描述】:
我在网页中有一个gridview
<asp:GridView ID="grid_search" runat="server" >
它包含列总价值的页脚
我在 Gridview 中有一个列名生产值
prod_val nvarchar(50)
对于数据绑定,我使用后面的代码
protected void grid_search_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
`tot_prodVal = tot_prodVal + Convert.ToDecimal(e.Row.Cells[2].Text);`
} }
但它在调试时显示错误
System.FormatException:输入字符串的格式不正确。
请给我解决方案..
【问题讨论】:
-
请显示
prod_val列的标记