gridview更新问题!
sqlcon = new SqlConnection(strCon);
string sqlstr = "update users set pe_user='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim() + "',pe_pwd='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "'where pe_userid='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
(无法将类型为“System.Web.UI.LiteralControl”的对象强制转换为类型“System.Web.UI.WebControls.TextBox”。)
sqlcom = new SqlCommand(sqlstr, sqlcon);
sqlcon.Open();
sqlcom.ExecuteNonQuery();
sqlcon.Close();
GridView1.EditIndex = -1;
bind();
就是上面出问题了 求助啊 把.Text.ToString().Trim该为那什么也不对 不知道怎么弄了