getting last record

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
 
A

Alex Feinman [MVP]

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top