Home All Groups Group Topic Archive Search About

Handling paging in the UI without using datagrid/dataview

Author
30 Mar 2005 12:29 AM
Hari
Hi

Please give me some inputs on the following :

Iam planning to use a custom control to list a large number of records from
sql database through ado.net.   so in the following code, if i give a select
* query, does the dataset holds the complete records in the memory? or is
there anyway i can set options in the dataset? or the paging logic need to be
done in UI side?

Hari


//Open Connection.
   SqlConnection conn = new
SqlConnection("Server=server;uid=login;pwd=pwd;database=northwind");

   //Set the DataAdapter's query.
   da = new SqlDataAdapter("select * from customers", conn);
   ds = new DataSet();

   //Fill the DataSet.
   da.Fill(ds, "customers");

Author
30 Mar 2005 1:46 AM
Val Mazur (MVP)
Hi,

When you call SELECT * FROM .., then yes all the records will be transferred
to the DataSet/dataTable. Next example shows you how to provide paging
without loading all the data

http://support.microsoft.com/default.aspx?scid=kb;en-us;829142

Or you could implement paging in a dataGrid control

http://support.microsoft.com/default.aspx?scid=kb;en-us;318131

--
Val Mazur
Microsoft MVP

http://xport.mvps.org



Show quote
"Hari" <H***@discussions.microsoft.com> wrote in message
news:45F97573-6980-4593-A1BB-810B31C6E459@microsoft.com...
> Hi
>
> Please give me some inputs on the following :
>
> Iam planning to use a custom control to list a large number of records
> from
> sql database through ado.net.   so in the following code, if i give a
> select
> * query, does the dataset holds the complete records in the memory? or is
> there anyway i can set options in the dataset? or the paging logic need to
> be
> done in UI side?
>
> Hari
>
>
> //Open Connection.
>   SqlConnection conn = new
> SqlConnection("Server=server;uid=login;pwd=pwd;database=northwind");
>
>   //Set the DataAdapter's query.
>   da = new SqlDataAdapter("select * from customers", conn);
>   ds = new DataSet();
>
>   //Fill the DataSet.
>   da.Fill(ds, "customers");
>

AddThis Social Bookmark Button