ASP.net navigating records

  • Thread starter Thread starter Mary
  • Start date Start date
M

Mary

I want to be able to create a web form that contains textboxes, that I
can nagivate thru ie:first, next , previous and last. As well as
diplaying the number of records and what record I am currently on.


I tried using this to fill the form with the records for each textbox
and column:

Textbox.Text = ds.Tables("TableName").Rows(currentRow)("ColumnName").ToString

And this for locating the previous record:

If currentRow > 0 Then
currentRow = currentRow - 1
End If

But they do not seem to work...
 
Hi
Try to keep a hidden textbox in the form and set its value to the current row number. the nexttime take this value from the hidden textbox and retrieve the next or previous row by using
currentRow = Ctype(hdnTextBox.Text,int16
Textbox.Text = ds.Tables("TableName").Rows(currentRow +1)("ColumnName").ToStrin

Hope that help
srini
 

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

Back
Top