Page 1 of 1

Linq to Sql - Retrieving the value of an identity column

Posted: Fri 17 Jul 2009 19:34
by jmartarelli
Hello, I'm wondering if there is a way to retrieve the identity value from an identity column before saving a new register.

When I run the query directly, using the SQL Server Management Studio I get the value.

Code: Select all

"SELECT IDENT_CURRENT ('alpa_Animais') AS AnimalID"


Does anyone know if there is a way to get this from a method inside a web app using Linq?

Thank you

Josi

Posted: Mon 20 Jul 2009 07:58
by AndreyR
Could you please post the DB definition of the identity column?
Are there any triggers associated with it in the database?