You cannot - the IDENTITY is only defined and stored once the row IS inserted.
What you can do at any time is check the current state of an IDENTITY with this code:
DBCC CHECKIDENT('your-table-name')
WARNING: there is NO guarantee that you will get the numerically next number in this IDENTITY once you insert a row in a heavily used concurrent system!
Marc
UPDATE:
OK, I have to ask this: why do you need to know the value of the IDENTITY field before actually inserting the data? Why not just insert your row and then read out the IDENTITY value that SQL Server has assigned to your ID field?
In your Linq-To-SQL class diagram, can you check two things:
- the field that holds your IDENTITY ID, is it set to "Auto Generate Value = True" ?
- the field that holds your IDENTITY ID, is it set to "Auto-Sync = OnInsert" or "Auto-Sync = Always" ?
If so - just insert your data, the value assigned to your ID will be reflected in your class right away. Isn't that good enough for your app?