0
I think you are person of Asp classical, since you have used rs.recordCount, but if you want to do this in ASP.net isuggest that you should use "SqlComd.ExecuteReader"
ie. SqlDataReader rdr = SqlCommand.ExecuteReader();
and iterate through end of record
ie.
While(rdr.Read())
{}
I think this will solve your problem
>>Munnamax
0
AFAIK, the recordCount returns the number of rows affected and is not applicable to a select statement, but in insert,update and delete only. And if you're working with a datareader, you have to traverse first the records before knowing the record count. In which case, you can have a call first for the row count using the count().
SELECT count(*) from myTable. then execute your real query.
or in your query for example, SELECT field1,field2 from myTable, you could modify it instead to select count(field1),field1,field2 from myTable so that it will be only one call. Implementation is up to you.
I normally would query it twice. First for the count. then for the actual data. Cheers!