|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using correctly SqlDataReaderHi
When I using a SqlDataReader returned by a ExecuteReader command is all data results loaded in memory or the database is accessed in each Read method of SqldataReader? Thanks in advance Javier Javier Martínez wrote:
> Hi It is accessed as you read.> When I using a SqlDataReader returned by a ExecuteReader command is all data > results loaded in memory or the database is accessed in each Read method of > SqldataReader? > Thanks in advance > Javier > > Thanks, then another question, when the sqldatareader is used by a
datagridcontrol when the pagination is done? Is released the same query each request? Show quote "john smith" <j***@smith.com> escribió en el mensaje news:Opj3SfDIGHA.3176@TK2MSFTNGP12.phx.gbl... > Javier Martínez wrote: >> Hi >> When I using a SqlDataReader returned by a ExecuteReader command is all >> data results loaded in memory or the database is accessed in each Read >> method of SqldataReader? >> Thanks in advance >> Javier > It is accessed as you read. Javier Martínez wrote:
Show quote > Thanks, then another question, when the sqldatareader is used by a Pagination for GridViews and DataGrids is done after getting all the > datagridcontrol when the pagination is done? > Is released the same query each request? > > "john smith" <j***@smith.com> escribió en el mensaje > news:Opj3SfDIGHA.3176@TK2MSFTNGP12.phx.gbl... >> Javier Martínez wrote: >>> Hi >>> When I using a SqlDataReader returned by a ExecuteReader command is all >>> data results loaded in memory or the database is accessed in each Read >>> method of SqldataReader? >>> Thanks in advance >>> Javier >> It is accessed as you read. > > results, on every single page request (same using Datsets, it pulls ALL the matching records regardless, on every page load). The only way around that is custom paging, using some fancy SQL to return only the rows you want (either using temp tables, or nested queries, etc). There are tons of articles about this, google is your friend :) |
|||||||||||||||||||||||