IcreatedaprojectinVB.NETinitwhenqueryingthecodeshowsmethetotalregistrythatthecalledonehas,howeverIneedittobeindescendingordersincewhensearchingmyformalwayscarriesthelastrecord.
FollowtheCode-
PrivateSubCarregaTabela()'-----PegaaQtddoregistrodeumchamado-------------stSQL="SELECT COUNT(*) AS QTD FROM PROVIDENCIA WHERE COD_OCORRENCIA = '" + txtCodOcorrencia.Text.PadLeft(10, "0") + "' "
comCommand = New OleDb.OleDbCommand(stSQL, conBase)
comCommand.CommandType = CommandType.Text
darProvidencia = comCommand.ExecuteReader()
darProvidencia.Read()
dtx = Convert.ToInt32(darProvidencia("QTD"))
End Sub
'----------- Páginação - posição dos botões ----------------------------------------------------
Private Sub MovimentarRegistro(ByVal e As eRegistro)
Select Case e
Case eRegistro.Primeiro
If posicao > 0 Then posicao -= 1
Case eRegistro.Ultimo
If posicao < (dtx - 1) Then posicao += 1
Case Else
posicao = dtx - 1
End Select
End Sub
Att,