asp.net mvc - NerdDinner difficulties -


i'm having problem create method of nerddinner tutorial, btw.

as can see here http://nerddinnerbook.s3.amazonaws.com/part5.htm in create method, removed id field of aspx page.

i did too, cannot add dinners because primary key violation.

how nerddinner controlling ids of each dinner? revised tutorial , not see references identity fields on sql database.

i created method me highest id in table:

    public int gethighestdinnerid()     {         int resultado = (from dinner in datacontext.dinners                          select dinner.dinnerid).max();         return resultado;     } 

which not work either.

any thoughts?

thank you

heya, i'm speculating here assume primary key should have auto-generated value property set true don't have explicitly set it, gets generated on insert. should able configure within dbml.

edit: looked through nerddinner tutorial , if @ step 2, talks setting id column identity column value auto-generated want configure it.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -