ID มีข้อมูลเป็น string ครับ รบกวนสอบถามผู้รู้หน่อยครับ errorที่สีแดงครับ Code (VB.NET)
Private Sub AutoGenerateMemberID()
Dim ItemID As Integer
Dim s As String = "select MAX( Bill_ID ) FROM Billing "
Dim dr As OleDbDataReader
dr = ExecuteReader(s)
While dr.Read()
ItemID = CInt(dr(0))
ItemID = ItemID + 1
tb_billingNo.Text = CStr(ItemID)
End While
dr.Close()
End Sub
Private Sub tb_billingNo_TextChanged(sender As Object, e As EventArgs) Handles tb_billingNo.TextChanged
AutoGenerateMemberID()
End Sub
Tag : .NET, Ms Access, Win (Windows App), VB.NET, VS 2012 (.NET 4.x)