日期:2014-05-18 浏览次数:20454 次
string sqlstr = "update ctgc set adjustday='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim() + "',remark='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim() + "'where serialID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
string sqlstr = "update ctgc set adjustday='" + ((Calendar)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).SelectedDate.ToShortDateString() + "',remark='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim() + "'where serialID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
------解决方案--------------------
用FindControl找出那个控件,取值不就行了
((控件类型)(GridView1.Rows[e.RowIndex].Cells[4].FindControl("控件名"))).