I'm learning Entity Framework under VC# 2010.
I have created a simple table for learning purposes, one of the fields is "id" type integer, identity set to true. I've generated Entity Data Model from that table and connected it with dataGridView. The problem is that it doesn't auto increment - each inserted row wants to be id=0 (which is impossible of course, since id must be unique)
What am I doing wrong? How should I configure EF or the SQL db itself?
The identity isn't set and incremented just by adding to the entity set... The entity isn't actually saved to the db until you call context.SaveChanges()...
db.AddToUserSet(user);//Added to EF entity collection db.SaveChanges();//INSERT executed in db, Identity set and incremented.