我想增加一个不。从 sql 它应该是这样的 13-001 但它使 13-1 这是我的代码
Private Sub getLastID()
Dim dr As SqlDataReader
Dim Cmd As New SqlCommand
con.Open()
With Cmd
.Connection = con
.CommandText = "SELECT * FROM tbl_student ORDER BY Student_no DESC"
End With
dr = Cmd.ExecuteReader
If dr.Read Then
lblStudentNo.Text = Val(dr.Item(0)) + 1
End If
con.Close()
End Sub
我应该怎么办?谢谢你