Have you looked at doing it it in your SQL statement and sorting the results
as part of the query?
Alternatively, you could use a generic dictionary and simply sort that,
using your FieldID as the Jey and CompleteRates as the item.
Dictionary<string, strings = new Dictionary<string, string>();
s.Add("1", "a Item");
s.Add("2", "c Item");
s.Add("3", "b Item");
List<KeyValuePair<string, string>myList = new List<KeyValuePair<string,
string>>(s);
myList.Sort(
delegate(KeyValuePair<string, stringfirstPair, KeyValuePair<string,
stringnextPair){
return firstPair.Value.CompareTo(nextPair.Value);
}
);
foreach (KeyValuePair<string, stringmyKey in myList) {
Response.Write(myKey.Key + " " + myKey.Value);
}
Regards
John Timney (MVP)
http://www.johntimney.com http://www.johntimney.com/blog
"MGRideout" <MG*******@discussions.microsoft.comwrote in message
news:90**********************************@microsof t.com...
Hello, I have a SQL string that pulls data out of a database - I then
calculate completerates based on Hours and # of Completes. I want to sort
this data (FieldID and CompleteRates) by CompleteRate from Highest to
lowest.
I have tried an array, but luck. Does anyone have some pointers or
sugguestins that I can get this done?
Thanks In Advance.
MGR