DataGrid更新事件的奇怪问题?
qiuji 2003-06-03 02:25:43 DataGrid的更新事件中:
string strSQL="update order_info set order_num="+((TextBox)e.Item.Cells[3].Controls[0]).Text+" where order_id="+DataGrid1.DataKeys[(int)e.Item.ItemIndex];
因为数据库中order_num字段是int类型,我在文本框中输入数字,但是((TextBox)e.Item.Cells[3].Controls[0]).Text是string类型的,出现了错误“指定的转换无效”,怎么办?