asp.net mvc 3 - How to get Max(ID) from Student and Create in MVC -
i using 1 mvc example in id incremental in database. create record like: in case id in student table not incremental, need max(id) student table.
[httppost] [validateantiforgerytoken] public actionresult create([bind(include = "id,lastname,firstmidname,enrollmentdate,countryid,account_code")] student student) { if (modelstate.isvalid) { db.students.add(student); db.savechanges(); return redirecttoaction("index"); } return view(student); }
i want remove "id" include , want max(id) student table through linq , save table. please me thanks. me please
Comments
Post a Comment