当前位置: 代码迷 >> ASP.NET >> 大家有沒有試過做一個表記錄數據庫的操作過程?该如何解决
  详细解决方案

大家有沒有試過做一個表記錄數據庫的操作過程?该如何解决

热度:4491   发布时间:2013-02-25 00:00:00.0
大家有沒有試過做一個表記錄數據庫的操作過程?
比如用戶刪除,修改時將該操作記錄下來,以便查看?

可是我現在遇到一個問題就是在
    protected   void   GridView1_RowDeleting(object   sender,   GridViewDeleteEventArgs   e)
        {
                conStr   =   System.Configuration.ConfigurationSettings.AppSettings[ "sqlConnectionString "].ToString();
                sqlStr   =   "delete   from   Frame   where   id= "   +   GridView1.DataKeys[e.RowIndex].Value.ToString();
                sqlConn   =   new   SqlConnection(conStr);
                sqlComm   =   new   SqlCommand(sqlStr,   sqlConn);
          string   FC   =   GridView1.Rows[e.RowIndex].Cells[2].Text;
          rec( "Delete ",FC);       //記錄刪除操作   FC為刪除的內容
        }

可是為什麼讀不到單元格內容?總是為空?

------解决方案--------------------------------------------------------
断代码
确定你的文本不是在模板列中
------解决方案--------------------------------------------------------
string FC = GridView1.Rows[e.RowIndex].Cells[2].Text;
这个对应的列是否有值 调式一下
你获取的列是否准确。
  相关解决方案