PC Review


Reply
Thread Tools Rate Thread

Fw: Strategy for Sorting in UI

 
 
M. A. Naveed
Guest
Posts: n/a
 
      16th Mar 2004
well i'm having almost the same problem. I'm displaying page wise records in
an aspx page. (DNA archecture using enterprise service and remoting)

Suppose the user has requested to see data from the customer table. The
customer table may contain 100 or even thousands of records, and I do not
want to fetch all records from the customer table, so I break up the result
into pages of data by using Top 25 Clause in SQL Select Statement and the
result is sorted by a unique column say IdentityColumn, each time when user
hits the next page button the next 25 records are to be fethced from the
table having greater value in unique id field of the last record of the
page.

The above page wise navigation is working fine. Now i'm having a different
scenario which i need to find some solution of it.

Now user wants to sort records at any coulum dislaying in a grid which is
not necessarily be unique. The problem is, which records are to be fetched
when user clicks on the Next Page button, the sorted column may not be
unique this time.

For Example, Homail Inbox, i can change sorting column to any one and
navigate inbox pages accordingly :0)

How do I navigate pages in this situation? im not fetching all the records
from the table, performance issue is critical.
Please comments,

thanks and regards,
M. A. Naveed
(E-Mail Removed)


----- Original Message -----
From: Alvin Bruney [MVP]
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Tuesday, March 02, 2004 11:34 AM
Subject: Re: Strategy for Sorting in UI


Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Guadala Harry" <(E-Mail Removed)> wrote in message
news:%23Y7QHZl%(E-Mail Removed)...
> I need to present users with a list - and then let them sort it in any
> arbitrary order they like. Each item to be sorted is a short string of
> text - there can be up to 50 items to sort. After the users are finished
> sorting, the sorted list gets sent back to the server. I'd appreciate any
> suggestions for how to accomplish this on the client (minimizing round
> trips) - including suggestions for specific UI controls.
>
> Thanks in advance.
>
>





 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      16th Mar 2004
You have to do your sort in the database query using a unique value.
However, that unique value doesn't have to be a single column. It can be a
combination of columns. So, for example, if you are sorting by "LastName"
and there may be duplicates, your query might look like the following:

SELECT * FROM myTable
WHERE LastName >= 'Spencer'
AND UniqueID > 420
ORDER BY LastName, UniqueID

You need to pass 2 or more values in order to make a unique value. The "420"
is the UniqueID of the last record returned by the last query.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"M. A. Naveed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> well i'm having almost the same problem. I'm displaying page wise records

in
> an aspx page. (DNA archecture using enterprise service and remoting)
>
> Suppose the user has requested to see data from the customer table. The
> customer table may contain 100 or even thousands of records, and I do not
> want to fetch all records from the customer table, so I break up the

result
> into pages of data by using Top 25 Clause in SQL Select Statement and the
> result is sorted by a unique column say IdentityColumn, each time when

user
> hits the next page button the next 25 records are to be fethced from the
> table having greater value in unique id field of the last record of the
> page.
>
> The above page wise navigation is working fine. Now i'm having a different
> scenario which i need to find some solution of it.
>
> Now user wants to sort records at any coulum dislaying in a grid which is
> not necessarily be unique. The problem is, which records are to be fetched
> when user clicks on the Next Page button, the sorted column may not be
> unique this time.
>
> For Example, Homail Inbox, i can change sorting column to any one and
> navigate inbox pages accordingly :0)
>
> How do I navigate pages in this situation? im not fetching all the records
> from the table, performance issue is critical.
> Please comments,
>
> thanks and regards,
> M. A. Naveed
> (E-Mail Removed)
>
>
> ----- Original Message -----
> From: Alvin Bruney [MVP]
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> Sent: Tuesday, March 02, 2004 11:34 AM
> Subject: Re: Strategy for Sorting in UI
>
>
> Your post went unanswered. Have you resolved this issue?
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/3he3b
> "Guadala Harry" <(E-Mail Removed)> wrote in message
> news:%23Y7QHZl%(E-Mail Removed)...
> > I need to present users with a list - and then let them sort it in any
> > arbitrary order they like. Each item to be sorted is a short string of
> > text - there can be up to 50 items to sort. After the users are finished
> > sorting, the sorted list gets sent back to the server. I'd appreciate

any
> > suggestions for how to accomplish this on the client (minimizing round
> > trips) - including suggestions for specific UI controls.
> >
> > Thanks in advance.
> >
> >

>
>
>
>



 
Reply With Quote
 
M. A. Naveed
Guest
Posts: n/a
 
      17th Mar 2004
I have also checked this query by additionally using TOP 25 in SELECT
statement. This almost give the desired output but here is a case what would
you suggest for that:

By this approch i.e. providing a unique value along with the desired sorted
column information, there are certain records which may not returned from
the database.
If there is a record containing LastName='TOM' and a uniqueID=100, this
will never fetch
Similarly all the records in a database which have lesser UniqueID than the
ID of last returned record of the page will never be fetched by this query.
Inshort those records which have value greater than 'Spencer' in lastName
and having lesser value than '420' in UniqueId, will never return.

thanks and regards,

M. A. Naveed
(E-Mail Removed)

Sr. Software Engineer
CorrTec Pvt. Ltd. Karachi




"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You have to do your sort in the database query using a unique value.
> However, that unique value doesn't have to be a single column. It can be a
> combination of columns. So, for example, if you are sorting by "LastName"
> and there may be duplicates, your query might look like the following:
>
> SELECT * FROM myTable
> WHERE LastName >= 'Spencer'
> AND UniqueID > 420
> ORDER BY LastName, UniqueID
>
> You need to pass 2 or more values in order to make a unique value. The

"420"
> is the UniqueID of the last record returned by the last query.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "M. A. Naveed" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > well i'm having almost the same problem. I'm displaying page wise

records
> in
> > an aspx page. (DNA archecture using enterprise service and remoting)
> >
> > Suppose the user has requested to see data from the customer table. The
> > customer table may contain 100 or even thousands of records, and I do

not
> > want to fetch all records from the customer table, so I break up the

> result
> > into pages of data by using Top 25 Clause in SQL Select Statement and

the
> > result is sorted by a unique column say IdentityColumn, each time when

> user
> > hits the next page button the next 25 records are to be fethced from the
> > table having greater value in unique id field of the last record of the
> > page.
> >
> > The above page wise navigation is working fine. Now i'm having a

different
> > scenario which i need to find some solution of it.
> >
> > Now user wants to sort records at any coulum dislaying in a grid which

is
> > not necessarily be unique. The problem is, which records are to be

fetched
> > when user clicks on the Next Page button, the sorted column may not be
> > unique this time.
> >
> > For Example, Homail Inbox, i can change sorting column to any one and
> > navigate inbox pages accordingly :0)
> >
> > How do I navigate pages in this situation? im not fetching all the

records
> > from the table, performance issue is critical.
> > Please comments,
> >
> > thanks and regards,
> > M. A. Naveed
> > (E-Mail Removed)
> >
> >
> > ----- Original Message -----
> > From: Alvin Bruney [MVP]
> > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > Sent: Tuesday, March 02, 2004 11:34 AM
> > Subject: Re: Strategy for Sorting in UI
> >
> >
> > Your post went unanswered. Have you resolved this issue?
> >
> > --
> > Regards,
> > Alvin Bruney [ASP.NET MVP]
> > Got tidbits? Get it here...
> > http://tinyurl.com/3he3b
> > "Guadala Harry" <(E-Mail Removed)> wrote in message
> > news:%23Y7QHZl%(E-Mail Removed)...
> > > I need to present users with a list - and then let them sort it in any
> > > arbitrary order they like. Each item to be sorted is a short string of
> > > text - there can be up to 50 items to sort. After the users are

finished
> > > sorting, the sorted list gets sent back to the server. I'd appreciate

> any
> > > suggestions for how to accomplish this on the client (minimizing round
> > > trips) - including suggestions for specific UI controls.
> > >
> > > Thanks in advance.
> > >
> > >

> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dot Net Strategy Ranjan.Das1978@gmail.com Microsoft ASP .NET 0 2nd May 2007 03:32 PM
Need a Strategy =?Utf-8?B?RGF2aWQgSGFiZXJjb20=?= Microsoft Access Form Coding 2 5th Aug 2005 06:00 PM
Fw: Strategy for Sorting in UI M. A. Naveed Microsoft ASP .NET 3 17th Mar 2004 08:30 AM
Strategy for Sorting in UI Guadala Harry Microsoft ASP .NET 2 2nd Mar 2004 07:34 AM
Best strategy? Laurel Microsoft Access Getting Started 4 2nd Jan 2004 02:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:22 AM.