获取自动增量主键每次都是以2增加 Post By:2018/9/9 9:21:00 [显示全部帖子]
cmd.CommandText = "Insert Into person (cardID, age)Values(?,?);Select SCOPE_IDENTITY()" cmd.Parameters.Add("@cardID",cardID) cmd.Parameters.Add("@age",age) cmd.ExecuteNonQuery() Dim id As Integer = cmd.ExecuteScalar() MessageBox.Show(id)