这是我的vb.net代码,当新记录插入的患者ID正在检查数据库值并增加下一个值...代码正常工作仅增加1到10.如果记录超过10值则不能递增。
Dim oleDBDR As OleDbDataReader
Dim oleDBCommand As New OleDbCommand
With oleDBCommand
.Connection = conn
.CommandText = "SELECT * FROM tblPatient ORDER BY PatientID DESC"
End With
oleDBDR = oleDBCommand.ExecuteReader
If oleDBDR.Read Then
txtPatientID.Text = Val(oleDBDR.Item(0)) + 1
End If