Linq to Sql - Retrieving the value of an identity column

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
jmartarelli
Posts: 2
Joined: Fri 17 Jul 2009 04:19

Linq to Sql - Retrieving the value of an identity column

Post by jmartarelli » Fri 17 Jul 2009 19:34

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 20 Jul 2009 07:58

Could you please post the DB definition of the identity column?
Are there any triggers associated with it in the database?

Post Reply