我想在删除一个条新闻。同时想日志文件里写入日志。但是我需要在日志里写入删除的新闻id和名称。不知道如何获得。
我该如合写代码。然后或得相关id和文章题目呢。写入到删除日志里这是我删除新闻的代码
string hcmd = "insert into [history](hoperator,htime,haction)values(@hoperator,@htime,'" + id + "')";
        con.Open();
        SqlCommand h_cmd = new SqlCommand(hcmd, con);        h_cmd.Parameters.Add("@hoperator", SqlDbType.VarChar, 30);
        h_cmd.Parameters["@hoperator"].Value = this.Label1.Text.ToString();        h_cmd.Parameters.Add("@htime", SqlDbType.DateTime);
        h_cmd.Parameters["@htime"].Value = DateTime.Now.ToString();        h_cmd.ExecuteNonQuery();
        con.Close();