IDENTITY_INSERT error when Inline Editing enabled

So I have a master-detail setup. On my detail section, I disabled modal popup by hiding the action bar and enabling inline editing so the user can quickly enter records on the grid. The first record is added successfully but the next record will error. This is always the scenario, only the first record is added unless I leave the page and go back.

I tested with SQL Profiler and these are the queries that were executed.

First add record:
exec sp_executesql N'insert into "dbo"."OrderProducts"
("OrderID","ProductID","Quantity","UnitID","UnitCost")
values(@p0,@p1,@p2,@p3,@p4)
',N'@p0 int,@p1 int,@p2 decimal(1,0),@p3 int,@p4 decimal(4,0)',@p0=1,@p1=59,@p2=1,@p3=3,@p4=1000

Second add record:
exec sp_executesql N'insert into "dbo"."OrderProducts"
("OrderID","ProductID","Quantity","UnitID","UnitCost","OrderProductID")
values(@p0,@p1,@p2,@p3,@p4,@p5)
',N'@p0 int,@p1 int,@p2 decimal(1,0),@p3 int,@p4 decimal(4,0),@p5 int',@p0=1,@p1=28,@p2=5,@p3=1,@p4=1500,@p5=NULL

where OrderProductID is the Identity Field. As you can see the field OrderProductID was added on the second query.
OrderProductID is an Int Identity and also read-only. And this field is not on any data views.
4 people have
this problem
+1
Reply