Hi i am using Entity framework 4.3.
I had a table “Notes” in which NoteId is primary key(data type is int). I generated value for NoteId like this by using stored procedure..
notes.NoteId = (int)dbContext.GeneratePrimaryKey("Notes");
When i am inserting data to the table “Notes” it raises that null value cannot be inserted into noteid. But the noteid is generated.
Can any one please help me to solve the issue….
I guess your mapping expects that the primary key is autogenerated in the database. In such case your value will not be used. Verify that in your EDMX the
NoteIdproperty hasStoreGeneratedPatternset toNone.