Generating index in a select

Countdown

New member
Local time
Today, 07:34
Joined
Oct 12, 2004
Messages
6
Hi,

Is it possible to select a bunch of data from a table (or more than one table) and get an index in the result set? I.e, I select a bunch of names that all have "ab" in them somewhere from this huge table. In my result set I want an index from 1 (or 0) to x where x is the last row in the table.

The reason I want to do this is that I can't find a way in asp.net (DataTable) to find the index of the row. Im doing a foreach statement of a view in that table and I can get the actual row I'm looking at, but I cant find out what its index in the table is.

If it is possible to find the row index of a DataRow just by having the row, that would be really nice. But if it isn't possible but it is possible to add an extra column for the row numbers that would be good to.

regards
Mattias
 

Users who are viewing this thread

Back
Top Bottom