protected void bnSubject_Click(object sender, EventArgs e) { BBSDataContext lq = new BBSDataContext(); //实例化LINQ类 BBSAnswer ba = new BBSAnswer(); //创建一个新对象 ba.uID = Convert.ToInt32(Session["uID"]); ba.bnID = Convert.ToInt32(Request["id"]); ba.baContent = txtbaContent.Text; ba.baAddTime = System.DateTime.Now; lq.BBSAnswer.InsertOnSubmit(ba); //执行插入数据操作 lq.SubmitChanges(); //提交数据库 Response.Redirect("BBSAnswerList.aspx?id=" + Request["id"]); //重新定位到该页面 }
private void detach_BBSAnswer(BBSAnswer entity) { this.SendPropertyChanging(); entity.BBSNote = null; }
private void attach_BBSAnswer(BBSAnswer entity) { this.SendPropertyChanging(); entity.BBSNote = this; }
partial void DeleteBBSAnswer(BBSAnswer instance);
partial void UpdateBBSAnswer(BBSAnswer instance);
partial void InsertBBSAnswer(BBSAnswer instance);