原创 DataGrid有模板列更新收藏

新一篇: Global.asax文件中 | 旧一篇: DataGrid综合(无模板列)


  private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
  {
   string updateCmd="update Socut_BBS set";
   updateCmd+="Poster ='"+((TextBox)e.Item.Cells[1].FindControl("TextBox1")).Text+"'";

   updateCmd+=" where ID ="+DataGrid1.DataKeys[(int)e.Item.ItemIndex].ToString();
   oleDbCommand1.CommandText=updateCmd;
   oleDbCommand1.Connection.Open();
   oleDbCommand1.ExecuteNonQuery();
   oleDbCommand1.Connection.Close();
   oleDbDataAdapter1.Fill(myDataSet1);
   DataGrid1.EditItemIndex=-1;
   DataGrid1.DataBind();

发表于 @ 2005年03月02日 17:29:00|评论(loading...)|编辑

新一篇: Global.asax文件中 | 旧一篇: DataGrid综合(无模板列)

评论:没有评论。

发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © cneee