473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Two-dimension array

tg
How can I sort a two-dimension array on the first dimension in the array?
If there's not a way to do it, how can I return the values of the first
dimension so that I can sort the values myself (bubble sort, etc.)?

Thank you
Nov 20 '05 #1
3 4537
Array.Sort(...)

http://aspnet.4guysfromrolla.com/art...60403-1.2.aspx

"tg" <tg*******@pop-server.houston.rr.com> wrote in message
news:KL*****************@twister.austin.rr.com...
How can I sort a two-dimension array on the first dimension in the array?
If there's not a way to do it, how can I return the values of the first
dimension so that I can sort the values myself (bubble sort, etc.)?

Thank you

Nov 20 '05 #2
tg
That only works with arrays that have one dimension ;(

"Jerry" <Je*********@Yahoo.com> wrote in message
news:e3*************@TK2MSFTNGP11.phx.gbl...
Array.Sort(...)

http://aspnet.4guysfromrolla.com/art...60403-1.2.aspx

"tg" <tg*******@pop-server.houston.rr.com> wrote in message
news:KL*****************@twister.austin.rr.com...
How can I sort a two-dimension array on the first dimension in the array? If there's not a way to do it, how can I return the values of the first
dimension so that I can sort the values myself (bubble sort, etc.)?

Thank you


Nov 20 '05 #3
As far as I know, you can't. However, you can define an object (or
structure) that represents each "row" in your current array, and store those
objects in a single-dimensional array or collection.

You can then implement the IComparer interface to define the criteria for
the objects should be sorted (e.g., first by LastName, then by FirstName, or
just by one particular property in the object -- the data in your current
first column.) Then, the objects will sort properly using Array.Sort.

http://msdn.microsoft.com/library/de...SortTopic1.asp

http://msdn.microsoft.com/library/de...classtopic.asp
"tg" <tg*******@pop-server.houston.rr.com> wrote in message
news:KL*****************@twister.austin.rr.com...
How can I sort a two-dimension array on the first dimension in the array?
If there's not a way to do it, how can I return the values of the first
dimension so that I can sort the values myself (bubble sort, etc.)?

Thank you

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: SimonC | last post by:
I'm looking to do something similar to a feature found on Ticketmaster.com, where you select your seats at a venue, and then you have two minutes in which to take or leave them. QUESTION 1a....
8
by: John Grenier | last post by:
Hi, I have to determine the "standing" (WIN - TIE - LOSS) from confrontations between two teams on a contest. The table matchResults has fields cont_id, team_id and contest_result (int). ...
6
by: Willem | last post by:
Hi, I have a newbie question: is it possible to make a search form in asp that searches in two different databases (access)? Willem
10
by: Hank1234 | last post by:
Can I use one Data Adapter and one Command Builder to update amny tables? Currently in my data adapter I query two tables and fill them into two tables in a data set. When I make a change to a...
6
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form...
7
by: Prabhudhas Peter | last post by:
I have two object instances of a same class... and i assigned values in both object instances (or the values can be taken from databse and assigned to the members of the objects)... Now i want to...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
9
by: dhable | last post by:
I just started working with Python and ran into an annoyance. Is there a way to avoid having to use the "from xxx import yyy" syntax from files in the same directory? I'm sure it's been asked a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.