Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Last Record

Status
Not open for further replies.

asafb

Programmer
Jun 17, 2003
80
US
Hello, I have a datagrid which is bounded using the databind feature. The SQL is SELECT * FROM customers for example, and it shows a beautiful grid! Now, I want it to display just teh LAST row from that table. How the heck do you do that in ADO.NET / ASP.NET land? With ASP classic, you do RST.MOVENEXT.

THANKS!!!!!!!
AB
 
You can index DataTable.Rows[0] of a DataTable, or implement filtering with a DataView (or use the DataSet.Select() method, etc., etc.).

With ADO.NET objects, the resultset is disconnected. All of the data is there for you to work with.

If you don't want to use the disconnected objects, I suppose you can also call DataReader.Read() for the equivalent of MoveNext.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top