I'm using sql-server 2005 and ASP.NET C#.
i have Users table with userId(int),userGender(tinyint),userAge(tinyint),userCity(tinyint). (simplified version of course).
I need to select always two fit to userID i pass to query users of opposite gender, in age range of -5 to +10 years and from the same city.
Important fact is it always must be two, so i created condition if @@rowcount<2 re-select without age and city filters.
Now the problem is that i sometimes have two returned result sets because i use first @@rowcount on a table. If i run the query.
Will it be a problem to use DataReader object to read from always second result set? Is there any other way to check how many results were selected without performing select with results?