how would i get the max value of a datbase field?
in vb6, i could've write
rs.open("select max(id) from table",cn)
how can i get this value in vb.net?
thanks in advance
Printable View
how would i get the max value of a datbase field?
in vb6, i could've write
rs.open("select max(id) from table",cn)
how can i get this value in vb.net?
thanks in advance
hi,
VB Code:
cmSQL = New SqlCommand("select max(id) from table",cnSQL) Dim maxid As Integer = cmSQL.ExecuteScalar()
hope this helps.
Marivic
thanks Marivic. it worked perfectly
thanks again