Solved

Searching the 2-D array

Posted on 2007-03-27
1
147 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now