Server Error in '/' Application.
During a save action an entity's update action failed. The entity which failed is enclosed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: SD.LLBLGen.Pro.ORMSupportClasses.ORMConcurrencyException: During a save action an entity's update action failed. The entity which failed is enclosed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
When I try to add a new record, I get an error like the one above.
I am using:
Visual Studio 2012
LLBLGen 3.5
Sql Server 2008 (10.50.1600)
Table1 (
Id identity primary key auto increment,
Field1,
Field2)
Table2 (
Id identity primary key auto increment,
Table1Id,
Field3,
Field4)
The adding process is done in the following way:
Step 1: Insert a new row to Table1 and get to "Id" {identity} (added to record)
Step 2: Insert a new row to Table2 (and use to "Table1.Id" value for Table2.Table1Id field)
This adding process is working our local (sql server 2012 (11.0.3128 )). But It isn't working in live server (sql server 2008 (10.50.1600)). Same database but I get the error.
Because, When I am add a new row to Table1, I can't get to return Id of last last inserted row. It is not return Id{identity} (Step 1). So I think, get the error to step 2...
This problem will be about to scope_identity. But I am not sure.
What Can I do this problem?