Advertisement

01.07.2008 at 05:24AM PST, ID: 23063342
[x]
Attachment Details

Hashtable Order

Asked by JRockFL in C# Programming Language

Tags: hashtable, order

How is the order of values in a hashtable determined?

I add them in this order...

        Hashtable hsh = new Hashtable();
        hsh.Add("@Product", "0");
        hsh.Add("@Description", "1");
        hsh.Add("@Price", "2");
        hsh.Add("@ProductID", "3");

But when I view the hashtable in the debugger it appears like this.
I think this might be causing a problem for me.
I need them to be in the same order as I add them.

+            ["@Product"]      "0"      
+            ["@ProductID"]      "3"      
+            ["@Description"]      "1"      
+            ["@Price"]      "2"      Start Free Trial
[+][-]01.07.2008 at 05:32AM PST, ID: 20598941

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.07.2008 at 05:35AM PST, ID: 20598964

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.07.2008 at 06:36AM PST, ID: 20599673

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.07.2008 at 07:43AM PST, ID: 20600247

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C# Programming Language
Tags: hashtable, order
Sign Up Now!
Solution Provided By: TheAvenger
Participating Experts: 4
Solution Grade: A
 
 
[+][-]01.07.2008 at 08:04AM PST, ID: 20600430

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.07.2008 at 08:07AM PST, ID: 20600456

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906