arraylist

  • Thread starter Thread starter NuB
  • Start date Start date
N

NuB

I'm working on an existing app that creates an arrayList of errors to
populate a log file. I need to get those errors to read them each line by
line and import them into tables based on the criteria then create a file
for which error was imported into the table.

How can i take the arraylist and break it down so i can read it as a string?
 
NuB,

What are you storing at each element in the arraylist? Is it a string?
If so, you should just use the foreach statement to read each element from
the array list, and on each iteration, write it to a log file, as well as
insert the record into the database.

Hope this helps.
 
I've tried that how he has it is like this:


public ArrayList errorList;
public ArrayList Errors { get { return errorList; }}

he then has an Error class, which gets the errors and returns them at once.
not one at a time but one big "blob" per say.

and he adds them like

errorlist.add(errorClass( ''message, etc.);

i have a for each statement but i'm getting the arraylist error message

Nicholas Paldino said:
NuB,

What are you storing at each element in the arraylist? Is it a string?
If so, you should just use the foreach statement to read each element from
the array list, and on each iteration, write it to a log file, as well as
insert the record into the database.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

NuB said:
I'm working on an existing app that creates an arrayList of errors to
populate a log file. I need to get those errors to read them each line by
line and import them into tables based on the criteria then create a file
for which error was imported into the table.

How can i take the arraylist and break it down so i can read it as a
string?
 
Back
Top