这是我写的一段更新的程序,这样引用对吗?
private void DataList1_UpdateCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
{
string smname,smsit,sql,smID;
smname=((TextBox)e.Item.FindControl("txtname")).Text;
smID=DataList1.DataKeys[e.Item.ItemIndex].ToString();
smsit=((TextBox)e.Item.FindControl("txtsit")).Text;
sql="Update smClass set smClassName='"+smname+"',smClassSit="+smsit+"where smClassID="+smID;
SqlConnection CN=DB.creatConnection();
SqlCommand smup=new SqlCommand(sql,CN);
CN.Open();
smup.ExecuteNonQuery();
CN.Close();
this.dltoBind();
// Response.Write("<script>");
// Response.Write("parent.iframe['middlelight'].reload('left.aspx');");
// Response.Write("</script>"); }
[此贴子已经被作者于2006-3-13 15:50:00编辑过]