Solved

Searching the 2-D array

Posted on 2007-03-27
1
154 Views
Last Modified: 2013-11-26
Hi,

I have a 2-D array. First dimension has name of control and the second dimension has the associated value. Let us say first dimension has name of all text boxes and the second has its value. Now how do I seach value for a particular text box, for example, I want to know the value of say txtName?

I do not want to loop through the array as my array will be large and this approach will be time consuimg.

Regards,
MI
0
Comment
Question by:vj_mi
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 18802900
The built-in search methods do not support multi-dimensional arrays.

If possible, I would not use an array, but use a Hashtable in .NET 1.1 or a Dictionary<string,???> in .NET 2.0 where ??? is the type of value you want to store.  There are much easier to search and manupulate than a 2-D array.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question