arraylist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NuB

    #1

    arraylist

    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?



  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: arraylist

    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]
    - mvp@spam.guard. caspershouse.co m

    "NuB" <CSharpCoder> wrote in message
    news:uJYSPZQcFH A.4040@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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?
    >
    >
    >[/color]


    Comment

    • NuB

      #3
      Re: arraylist

      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(e rrorClass( ''message, etc.);

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

      "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote in
      message news:%23PAaEvQc FHA.2420@TK2MSF TNGP12.phx.gbl. ..[color=blue]
      > 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]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "NuB" <CSharpCoder> wrote in message
      > news:uJYSPZQcFH A.4040@TK2MSFTN GP10.phx.gbl...[color=green]
      >> 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?
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      Working...