Click here to Skip to main content
15,881,760 members
Home / Discussions / C#
   

C#

 
GeneralReading Arabic text from text file Pin
Member 35841536-Feb-08 9:14
Member 35841536-Feb-08 9:14 
GeneralRe: Reading Arabic text from text file Pin
Not Active6-Feb-08 9:19
mentorNot Active6-Feb-08 9:19 
GeneralRe: Reading Arabic text from text file Pin
led mike6-Feb-08 9:21
led mike6-Feb-08 9:21 
GeneralRe: Reading Arabic text from text file Pin
Guffa6-Feb-08 13:55
Guffa6-Feb-08 13:55 
GeneralAccessing members of a class in an ArrayList Pin
hpjchobbes6-Feb-08 8:59
hpjchobbes6-Feb-08 8:59 
GeneralRe: Accessing members of a class in an ArrayList Pin
led mike6-Feb-08 9:15
led mike6-Feb-08 9:15 
GeneralRe: Accessing members of a class in an ArrayList Pin
Jimmanuel6-Feb-08 9:16
Jimmanuel6-Feb-08 9:16 
GeneralRe: Accessing members of a class in an ArrayList Pin
J$6-Feb-08 9:21
J$6-Feb-08 9:21 
hpjchobbes wrote:
My understanding of why the first way doesn't work is because an ArrayList could hold different object types. So I need to box/unbox it before I can use it


Sounds about right to me.

You could use a Generic List to achieve what you're trying to do. It is in the System.Collections.Generic namespace, and is similar to an array list, but the items contained in it are strongly typed (so you won't have to do the boxing/unboxing)

You could use it as follows:
<br />
List<Customer> myCustomerList = new List<Customer>();<br />
<br />
Customer customer = new Customer();<br />
<br />
myCustomerList.Add(customer);<br />
myCustomerList[0].Name = "Bob Smith";<br />


----
Edit: Doh! Too slow...
AnswerRe: Accessing members of a class in an ArrayList Pin
Guffa6-Feb-08 9:22
Guffa6-Feb-08 9:22 
GeneralRe: Accessing members of a class in an ArrayList Pin
hpjchobbes6-Feb-08 9:41
hpjchobbes6-Feb-08 9:41 
GeneralRe: Accessing members of a class in an ArrayList Pin
User 66586-Feb-08 10:05
User 66586-Feb-08 10:05 
AnswerRe: Accessing members of a class in an ArrayList Pin
Guffa6-Feb-08 10:28
Guffa6-Feb-08 10:28 
GeneralMS SQL 2005 Pin
s3rro6-Feb-08 8:59
s3rro6-Feb-08 8:59 
GeneralRe: MS SQL 2005 Pin
J$6-Feb-08 9:13
J$6-Feb-08 9:13 
GeneralRe: MS SQL 2005 Pin
Not Active6-Feb-08 9:17
mentorNot Active6-Feb-08 9:17 
AnswerRe: MS SQL 2005 Pin
Nouman Bhatti6-Feb-08 21:54
Nouman Bhatti6-Feb-08 21:54 
GeneralBinding to DataTable built from mutliple database tables Pin
polishprogrammer6-Feb-08 8:54
polishprogrammer6-Feb-08 8:54 
GeneralRe: Binding to DataTable built from mutliple database tables Pin
Gareth H6-Feb-08 9:29
Gareth H6-Feb-08 9:29 
GeneralRe: Binding to DataTable built from mutliple database tables Pin
polishprogrammer6-Feb-08 9:49
polishprogrammer6-Feb-08 9:49 
GeneralRe: Binding to DataTable built from mutliple database tables Pin
Gareth H6-Feb-08 11:34
Gareth H6-Feb-08 11:34 
GeneralRe: Binding to DataTable built from mutliple database tables Pin
polishprogrammer6-Feb-08 18:08
polishprogrammer6-Feb-08 18:08 
News.NET Reference Code Downloader For Debugging With Visual Studio 2005 Pin
Izzet Kerem Kusmezer6-Feb-08 8:36
Izzet Kerem Kusmezer6-Feb-08 8:36 
QuestionI am sorry if I am asking an abstract question; but I have a multithreaded question Pin
sameerhanda6-Feb-08 7:33
sameerhanda6-Feb-08 7:33 
GeneralRe: I am sorry if I am asking an abstract question; but I have a multithreaded question Pin
Jimmanuel6-Feb-08 8:00
Jimmanuel6-Feb-08 8:00 
GeneralRe: I am sorry if I am asking an abstract question; but I have a multithreaded question Pin
sameerhanda6-Feb-08 8:19
sameerhanda6-Feb-08 8:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.