db info to an array

keko2004

Active member
Joined
Feb 13, 2006
Messages
39
Location
Middle Village, NY
Programming Experience
1-3
how can i load a set of id numbers from my customer table so i can check the newly generated ones against the ones that are already generated? i would guess to store them in an array but im not sure how. any help would be great
 
well 1st create field of Number datatype and enter a number like 1001. Then each time you want to add say a new member just find the last number and increase for one i.e.

VB.NET:
strSQL = "SELECT MAX(myID) AS LastMember FROM myTABLE"
'blah blah
Dim myNewMember as Integer = Ctype(cmd.ExecuteScalar, Integer) + 1
now insert the new member:
VB.NET:
strSQL = "INSERT INTO myTABLE(myID) VALUES(" & myNewMember & ")"
'blah blah
cmd.ExecuteNonQuery

Regards ;)
 
Back
Top