Hi, I wish to build a datagrid, in an ASP.NET web page, in which I can display a row from a table and when I press a button it will move forward one row. The table is not currently sorted and I need it to be alpahbetical by surname so I thought if I created a view I could sort the table alphabetically on the 'Surname' column. I know that ADO.NET when used in disconnected mode doesn't have a cursor which remembers the last row it was on so I thought if I could create an autonumber on the view then I could use this in the 'where' clause to tell SQLserver which line I wished to select by taking the previous number and adding one. Is this the best way to do this and if so could some one give advice on how to write the line of the query that will add in an autonumber column
thanks
Johnwhy don't you just use the standard paging method with a pagesize of one?
(no views, don't have autonumbering unless you feel like generating one from a cursor)|||The table has over 100,000 rows in it so I don't wish to pull all these into a dataset as I thought this would be far too big if lots of users were going to use the website at once. I thought using paging it stepped through a dataset not the actual SQL table. I just want a way that I can find the next row each time.
I will look at the paging method. thanks
John
No comments:
Post a Comment