Home All Groups Group Topic Archive Search About
Author
12 May 2005 6:39 PM
abcd
I am using DropdownList control and it is popued up by my datareader

How can I sort the items...neither DropDownlist non data reader has sort
method

lstTitleList.DataSource = myReader;
lstTitleList.DataTextField = "Title";
lstTitleList.DataValueField = "Value";
lstTitleList.DataBind();

thanks

Author
12 May 2005 8:16 PM
abcd
got it solved using DataSet and DataView.

It looks that DataReader is forwardonly and there is no facility for
sorting...

thanks


Show quoteHide quote
"abcd" <a***@abcd.com> wrote in message
news:uMfDqHyVFHA.2616@TK2MSFTNGP14.phx.gbl...
>I am using DropdownList control and it is popued up by my datareader
>
> How can I sort the items...neither DropDownlist non data reader has sort
> method
>
> lstTitleList.DataSource = myReader;
> lstTitleList.DataTextField = "Title";
> lstTitleList.DataValueField = "Value";
> lstTitleList.DataBind();
>
> thanks
>
>
Author
13 May 2005 11:46 AM
Teemu Keiski
Unless you do the sort in the SQL query itself. But if you need to swith the
order (user-defined sorting, and more than one column), then using
DataView/DataSet is ok because you don't have to pass the sort info so much
to the database.

On the other hand it *is*doable with dataReader as well (getting dataSet etc
always adds little overhead, though it also can bring performance in terms
of caching and so on

--
Teemu Keiski
ASP.NET MVP, Finland


Show quoteHide quote
"abcd" <a***@abcd.com> wrote in message
news:Ox3ZJ%23yVFHA.1384@TK2MSFTNGP09.phx.gbl...
> got it solved using DataSet and DataView.
>
> It looks that DataReader is forwardonly and there is no facility for
> sorting...
>
> thanks
>
>
> "abcd" <a***@abcd.com> wrote in message
> news:uMfDqHyVFHA.2616@TK2MSFTNGP14.phx.gbl...
>>I am using DropdownList control and it is popued up by my datareader
>>
>> How can I sort the items...neither DropDownlist non data reader has sort
>> method
>>
>> lstTitleList.DataSource = myReader;
>> lstTitleList.DataTextField = "Title";
>> lstTitleList.DataValueField = "Value";
>> lstTitleList.DataBind();
>>
>> thanks
>>
>>
>
>