Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MultiDimensional ArrayList 1

Status
Not open for further replies.

blairacuda

Technical User
Sep 3, 2009
51
US
I have another easy one for all you gurus out there. I am trying to get at data in a MultiDimensional ArrayList (is that redundant?) but am struggling with the syntax and can't seem to find a good source. So I turn to you guys again.

I need to increment an int to get at the correct record at level 1. But at level 2 I know I always need record 2. But this gives me a compiler error:
Code:
string row = allFittingFields[i,2].ToString();

The closest help I have been able to find was this:
Code:
Response.Write((MainArray[1] as ArrayList)[0].ToString());

Thanks in advance.

Chris Blair
Crystal, InstallShield, branching out in other programming realms.
 
you'll need to provide more code. enough to reproduce the problem. I will say that it's not common in .net to use multidimensional arrays, that's what lists, dictionaries and POCO's are for.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
@jmeckley - sorry it took me so long to respond back to you. i don't know why i started using ArrayLists. i was filling out a DataTable from a database and then converting that to an ArrayList. so now am just using the DataTable and am getting what i need now. but i do have a different question on DataGridView. i'll start a new thread for that one.

Chris Blair
Crystal, InstallShield, branching out in other programming realms.
 
datatables are useful for data-centric applications where you have forms over data. if you system is heavy with logic and complexity I would recommend replacing the datatables with POCOs (plain old compiled objects) and encapsulating the logic yourself. This is much easier to maintain and creates a self documenting domain.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
I am just writing a small app that reads from a database, allows users to change some info, then save the new info back to the database. There isn't a whole lot to it.

My problem is that I am a beginner...

CBlair
Crystal, InstallShield, branching out in other programming realms.
 
it's not a problem to be beginner. we are all beginners at one point. The "problem" is not wanting to grow.

I remember when all I understood was stored procs and datasets. then I discovered the concepts of domains and domain driven design, that lead to common design patterns which lead to additional 3rd party frameworks to solve problems like inversion of control, object relational mapping and better management of workflows for web applications.

there is a vast world of programming beyond MS's IDE wizards and patterns & practices write ups.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Man I hope there is a wider world out there than MS... I keep running into things that I think it should be this way or that way. But that just might be beginner's frustrations.

The POCO method is something I want to get into. Is there a good place to start learning it other than just trial and error?

CBlair
Crystal, InstallShield, branching out in other programming realms.
 
the bible of domain driven design is eric evan's book Domain Driven Design. (the Blue Book)

Just about anthing written by Martin Fowler is also worth reading.

Websites and bloggers:

and if you can get the training
Nothin' but .Net by jp boohoo. It's worth every penny and a whole lot more.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks!

CBlair
Crystal, InstallShield, branching out in other programming realms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top