[.NET] DataReader, DataAdapter.Fill() performance question
Ok, so I am trying to figure out if DataAdapter.Fill() is efficient.
SQL Server, itself, has no real paging ability. If you want to see the Nth set of 10 records, you have to do some funky sql to get the results you want. It's a bitch to do queries like this, because you have to exec(sqlstringhere). If you are trying to used stored procedures, it makes them 100% pointless as you are generating a new string each time the stored procedure is called. There are other methods, but they are complicated. The point in doing sql this way is to return ONLY the data you want to display and not the other 10,000 records that the query without paging returns.
In the .NET framework, the DataAdapter.Fill() allows you to set a starting record, and how many records to return after the starting record. I know that the .Fill method uses a DataReader, but my question is this:
Using .Fill(), will sql server return all 10,000 records, then doing its "limit" in the .NET framework.
OR
ONLY the count of recurds to return after the starting record? And if so, HOW is this done in sql server? What commands do you have to give sql server to do the paging (what does the DataReader do that is so special)?
My problem with just using it and not knowing is, if you have your database server and web server seperate (any large project does), why transfer 10k records worth of data time after time when you are only going to display, say, 25 records?
__________________
Patterns have a habit of repeating themselves.
|