db.Execute(@"
INSERT INTO OrderStatus
(Price, Status, PricingTime, WordsNum, DeliveryTime)
VALUES (@0, @1, @2, @3, @4)",
null, App.strUnVisited, null, null, null);
db.Execute(@"
INSERT INTO OrderDetails
(FileName, Lang, Description, Time, UserId, Subject, Field, AuditNum)
VALUES (@0, @1, @2, @3, @4, @5, @6, @7)",
ConcatFileNames, LangSelect, Description, DateTime.Now, WebSecurity.CurrentUserId, Subject, Field, AuditNum );
I have a table
'OrderStatus'
with identity column
'AuditNum'
. The problem occurs when I wana do the second insert (in OrderDetails table). I need the
AuditNum
value that is automatically generated while the first inserting in order to give it to the second insert method as a (last) parameter. How can I do that (without concurrency problem)?