Skip to content Skip to sidebar Skip to footer

ASP.NET Tableadapter Insert Not Returning The Correct Identity Value

In my Visual Studio 2008 ASP.NET web page codebehind, I am calling an add routine in an SQL tableadapter, as follows. NewLabID = LabItem.AddLaborItem(ThisWONum, TechID, DateTime.

Solution 1:

ExecuteNonQuery returns the number of rows affected. You will want to use ExecuteScalar() instead.


Post a Comment for "ASP.NET Tableadapter Insert Not Returning The Correct Identity Value"