Is it possible to use the datareader resultset more than a time? if record exists then only i need to loop through records. currently i use reader=cmd.Executereader 2 time one time for getting count then for processing.
As far as I know DataReader does not provide the count information (other than of course, by reading it as you are doing). DataReader is a forward only reader, so you cannot go back and pick up data you have already read either.
Your options would be: a) To read the data into a list/array in your .net code and process the list to get the count and to do any other processing. b) Add a parameter to your query to return the count from T-SQL.