Code:
Dim sql as string
------------------- your Connection
Sql="Select Count(STDID) as ID from STUDENTTable"
dim cmd as Sqlcommand
cmd.connection= your Connection
cmd.commandtype=commandText
cmd.commandtext=SQL
Dim RDR as SQlDatareader
RDR=cmd.executeRearder
If RDR.read then
Label1.text=RDR.Items("ID")+1
end if
Leave a comment: