大虾,快来呀!!等...
protected void gvSupplier_RowUpdating(object sender, GridViewUpdateEventArgs e){
SqlConnection conn = new SqlConnection("Data Source=localhost;database=cpinfo;Integrated Security=true");
conn.Open();
int id = e.RowIndex;
GridViewRow gvr = this.gvSupplier.Rows[id];
int Id = int.Parse(gvSupplier.DataKeys[e.RowIndex].Value.ToString());
string userid = ((TextBox)gvr.FindControl("txtuserid")).Text.ToString();
string userName = ((TextBox)gvr.FindControl("txtusername")).Text.ToString();
string userloginID = ((TextBox)gvr.FindControl("txtuserloginid")).Text.ToString();
string userpassword = ((TextBox)gvr.FindControl("txtuserpassword")).Text.ToString();
string sqlString = "update manggerUser set userid='" + userid + "',userName='" + userName + "',userloginID='" + userloginID + "',userpassword='" + userpassword + "' where id=" + id;
SqlCommand com = new SqlCommand(sqlString, conn);
int result = com.ExecuteNonQuery();// ExecuteSql(sqlString);
conn.Close();
if (result == 1)
{
Label6.Text = "OK";
//......
}
this.gvSupplier.EditIndex = -1;
this.BindGvSupplier();
}
怎么数据库和页面的数据都没有变化呀??帮看看! --------------------编程问答-------------------- 大家帮我看看! --------------------编程问答-------------------- 没有重新绑定
补充:.NET技术 , ASP.NET