i start work linq, dbcontext doesn't have submitchanges method. should default in class. right?
using system; using system.data.entity; using system.data.entity.infrastructure; public partial class libraryentities : dbcontext { public libraryentities() : base("name=libraryentities") { } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { throw new unintentionalcodefirstexception(); } public virtual dbset<user> users { get; set; } public virtual dbset<msreplication_options> msreplication_options { get; set; } public virtual dbset<spt_fallback_db> spt_fallback_db { get; set; } public virtual dbset<spt_fallback_dev> spt_fallback_dev { get; set; } public virtual dbset<spt_fallback_usg> spt_fallback_usg { get; set; } public virtual dbset<spt_monitor> spt_monitor { get; set; } public virtual dbset<book> books { get; set; } }
when try call submitchanges, says method not exist. know why?
int id = (int)httpcontext.current.session["userid"]; var query = (from u in db.users u.id == id select u).firstordefault(); query.firstname = firstnamemodal.text; db.submitchanges();
the method you're looking called savechanges
.
Comments
Post a Comment