目前本人收集的最全的LINQ入门资料~~大家一起L(15)
时间:2025-02-26
时间:2025-02-26
收集的最全的LINQ入门资料
然后,再创建一个Admin.aspx,前台代码如下:
收集的最全的LINQ入门资料
后台代码:
收集的最全的LINQ入门资料
rpt_Message.DataSource = from gb in ctx.tbGuestBooks orderby gb.PostTime descending select gb; rpt_Message.DataBind(); } protected void rpt_Message_ItemCommand(object source, RepeaterCommandEventArgs e) { if (mandName == "DeleteMessage") { StreamWriter sw = new StreamWriter(Server.MapPath("log.txt"), true); ctx.Log = sw; tbGuestBook gb = ctx.tbGuestBooks.Single(b => b.ID == new Guid(mandArgument.ToString())); ctx.tbGuestBooks.Remove(gb); ctx.SubmitChanges(); SetBind(); sw.Close(); } if (mandName == "SendReply") { StreamWriter sw = new StreamWriter(Server.MapPath("log.txt"), true); ctx.Log = sw; tbGuestBook gb = ctx.tbGuestBooks.Single(b => b.ID == new Guid(mandArgument.ToS
tring())); gb.Reply = ((TextBox)e.Item.FindControl("tb_Reply")).Text;
下一篇:无机化学实验二十五 铁、钴、镍