DataGrid has a template column update

xiaoxiao2021-03-06  43

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 ();

转载请注明原文地址:https://www.9cbs.com/read-51667.html

New Post(0)