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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -