如何在本身存在的情况下GridView
动态删除/编辑行Buttons
GridView
我已经尝试过RowDeleting
删除和RowEditing
编辑的事件。但是,我无法得到想要的结果
使用 VS2005 asp.net C# 2.0
以下是我在RowDeleting
活动中尝试过的
protected void GridViewFRM_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (connection.State == ConnectionState.Closed)
{
connection.Open();
}
OracleCommand OLCOM3 = new OracleCommand();
OLCOM3.CommandText = "Delete from FORUM WHERE QUESTION='" + GridViewFRM.DataKeys[e.RowIndex].Values[0].ToString() + "'";
OLCOM3.ExecuteNonQuery();
DisplayUserData();
}