ASP.NET tableadapter insert not returning the correct identity value

前端 未结 1 1021
栀梦
栀梦 2021-01-16 10:05

In my Visual Studio 2008 ASP.NET web page codebehind, I am calling an add routine in an SQL tableadapter, as follows.

NewLabID = LabItem.AddLaborIt         


        
相关标签:
1条回答
  • 2021-01-16 10:44

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

    0 讨论(0)
提交回复
热议问题