protected void Button2_Click(object sender, EventArgs e)
{
string Delstring=DataList1.DataKeys[e.Item.ItemIndex];
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=E:\\asp.net开发\\ASP.NET完全自学手册(光盘)\\源文件\\ch10\\App_Data\\MsgBoard.mdb";
string sql = "delete post where postid='" + Delstring + "'";
OleDbCommand comm = new OleDbCommand(sql, conn);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
Response.Redirect("index.aspx");
}
编译器错误信息: CS0117: “System.EventArgs”并不包含“Item”的定义