getting last record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi..i'm consuming web services in my PPC app, i would like to ensure that ids are auto generated..in vb 6, i could use ado.recordset.movelast, assigned it to a variable then add with 1..how can i do that in .net compact framework?after i declare my connection , what should i do to get the last records?thanks
 
Something like:
Dim cmd as new SqlCeCommand("select TOP 1 ID from myTable order by ID desc",
conn)
Dim lastID as Integer = CInt(cmd.ExecuteScalar())

--
Alex Feinman
---
Visit http://www.opennetcf.org
chris said:
hi..i'm consuming web services in my PPC app, i would like to ensure that
ids are auto generated..in vb 6, i could use ado.recordset.movelast,
assigned it to a variable then add with 1..how can i do that in .net compact
framework?after i declare my connection , what should i do to get the last
records?thanks
 
ok..thanks

Alex Feinman said:
Something like:
Dim cmd as new SqlCeCommand("select TOP 1 ID from myTable order by ID desc",
conn)
Dim lastID as Integer = CInt(cmd.ExecuteScalar())

--
Alex Feinman
---
Visit http://www.opennetcf.org

ids are auto generated..in vb 6, i could use ado.recordset.movelast,
assigned it to a variable then add with 1..how can i do that in .net compact
framework?after i declare my connection , what should i do to get the last
records?thanks
 
Back
Top