black zero
Well-known member
- Joined
- Jan 15, 2009
- Messages
- 53
- Programming Experience
- Beginner
I have a code like this:
However, I'd like to know if there's a faster way to get the last 'Val(drT.Item(0))' from Kelancaran database.
Also, if I'm using that code, tempcounter variable sometimes doesn't show the latest record from drT.Item(0)... well...
Any information is really appreciated.
VB.NET:
Dim counter2 As Integer
cmdT = New SqlCommand("select * from Kelancaran", con)
drT = cmdT.ExecuteReader()
Do While drT.Read
tempcounter = Val(drT.Item(0))
Loop
drT.Close()
cmdT.Dispose()
counter2 = tempcounter + 1
labeltransaction.Text = counter2
tempcounter = counter2
However, I'd like to know if there's a faster way to get the last 'Val(drT.Item(0))' from Kelancaran database.
Also, if I'm using that code, tempcounter variable sometimes doesn't show the latest record from drT.Item(0)... well...
Any information is really appreciated.