Thanks for the replies.
I run across this in many question in many applications. Here is a more
concrete example, and the one the prompted me to ask the question. Although
there are lots of ways to get the job done (and in fact the job is not being
slowed down by this question), I really want to know what the best "software
engineering" approach is.
I am creating exchange mailboxes in a test domain to emulate our faculty,
staff, grads, and undergrads. Each have different quotas. So a read a
config file into a sealed, static (whatever it is) class that contains a
section like:
Faculty 80000 100000
Staff 65000 100000
Grad 25000 30000
Undergrad 7000 10000
From one class I have
myUser = new User(joe, test, faculty)
then:
public class User {
// Constructor
public User (string first, string last, string status) {
if (Config.isStatus(status)) // check for a valid
argument
myStatus = status;
}
// Property
public long mDBOverQuotaLimit {
get { return Config.hardLimit(status); }
}
}
How should I store the data in Config so that it is easy to get to? It
seems like there should be a pre-built class designed for this.
I will look at the datatable if that is the best method.
bob
"Bob Weiner" <bo*@engr.uconn.edu> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I'm new to C#.
What is the best (in terms of programmability and use) data structure to
use to maintain an array of information with containing 3 fields of differing
types. For instance:
string name
int age
bool gender
If I created an array of structs would I be able to retrieve an age for a
given name without writing a search routine? Can I use the Array.IndexOf
method to retrieve the correct record?
Would a Hashtable/Dictionary be more efficient? Do I need to create my
own class? With VB6 I've used a recordset but bringing in ADO seems like
overkill.
Not vital but I would like to put the perenial problem to rest.
thanks,
bob