I am using an Entity Framework 4 connection to connect to a SQL 2008 server to process the database for my application.
I use C # in Visual Studio 2010, and my question is about primary key fields that are incremented by SQL itself, is it possible at all so that I can find the identifier that will be used next to the database.
The reason that I can’t just find the last element and +1 is because if my table contains elements 1,2,3,4 and 5, deleting element 5, then adding another will cause the next element to become element 6, not 5 again (since I am using the Identity specification in SQL, but this must be used).
I can’t find any method like Item.ID.GetNextIdentity () or something like that, and looked through as many similar questions as this, but to no avail.
Any help would be appreciated
source
share