Get specific rows from a database via ADO.Net
If your table is really that small (i.e. 10 rows) why not just fetch all 10 rows and iterate over to get to the 5th / 7th row ... as far as directly fetching ... How is your key tables. That is, What determines what the 5th and 7th lines are?
You ORDER BY your query ...
If you want to get the 7th row from the top based on a specific order, you can do something UGLY Like.
SELECT
Top 1 *
FROM
(
SELECT
Top 7 *
FROM
TABLE ORDER BY 1 ASC
) as a
ORDER BY 1 DESC
OR if you are working with SQL2005 / Oracle / Other DBMS with a RowNumber () function similar to the one used for paging, then this will work too, but it depends entirely on the structure of your table, database, using and how you retrieve this information ...
a source to share
You usually don't restore a specific row when you return a query. Your fifth line might be some specific data this time, but it might change at any time, as no db engine guarantees that the query will return that specific string unless you can definitively specify it with a where clause.
In the weird case where you want to return a specific row, this will change depending on the database you are using (you can use rownumber combination in oracle or top in sql server).
a source to share
It depends on what type of database you are using. Different databases, such as SQL Server and MySQL, have different swap handling methods that you basically want to do. Even different versions like SQL Server 2000 have different methods than 2005 etc.
Here is one source to help you understand the concept and implementation. Here's another one that might be closer to what you're looking for.
a source to share