NerdDinner difficulties

Posted by George on Stack Overflow See other posts from Stack Overflow or by George
Published on 2010-04-27T21:24:43Z Indexed on 2010/04/27 21:53 UTC
Read the original article Hit count: 330

Filed under:
|

Hello guys,

I'm having a problem with the Create method of the NerdDinner tutorial, which is very good BTW.

As you can see here http://nerddinnerbook.s3.amazonaws.com/Part5.htm in the Create method, he removed the ID field of the aspx page.

I did that too, but I cannot add any dinners because I get a primary key violation.

How is NerdDinner controlling the ids of each dinner? I revised the tutorial and could not see any references to identity fields on SQL database.

I even created a method to get me the highest id in the table:

    public int GetHighestDinnerId()
    {
        int resultado = (from dinner in dataContext.Dinners
                         select dinner.DinnerId).Max();
        return resultado;
    }

which does not work either.

Any thoughts?

Thank you

© Stack Overflow or respective owner

Related posts about nerddinner

Related posts about asp-mvc