ASP.NET stream writer problem

Discussion in 'ASP .Net' started by Ryan Ternier, Nov 25, 2004.

  1. Ryan Ternier

    Ryan Ternier Guest

    I'm writing a file out using StreamWriter. What i'm outputting is a 6,398
    lines of stupid Jscript arrays.
    Yes the system needs to be very very dynamic, and they don't want a page
    reload.

    The arrays are so huge because the program needs:
    Take table 1, and join each row in table 1 to X rows in Table 2.
    Take each row in table 2 and assign it to X rows in table 3.
    Take each row in table 3 and assign it to X rows in table 4... and so on.
    ick.

    It runs the code, and writes the file, but only writes half of the file.
    The stream getting output is over 300KB long.

    It might be that the string datatype is too short to hold all this
    information so I switched:

    MyString &= "..."
    to
    objStreamWriter.WriteLine("...")

    This too only generates only half the file. It outputs about 120 KB of
    data. Using another utility to create this file from the DB it makes it 300
    kb, and the code is Exactly the same.

    The stream writer hits every section of it. Even the closing </script> tag,
    but the file gets cut in half.

    Here's how i'm declaring the stream writer:
    -----------------
    Dim objStreamWriting as new
    System.IO.StreamWriter(objUtil.server.MapPath("/Classification.js",False)

    objStreamWriting.WriteLine("<script language=""JavaScript"">")
    .....
    For loop 1
    ....
    For loop 2
    ....
    For loop 3
    .... inside this loop is where it will usually end. Around line # 2097
    ....
    objStreamWriting.WriteLine("</script>")

    objStreamWriting.Close
    objStreamWriting = nothing


    Anyone have any suggestions?
     
    Ryan Ternier, Nov 25, 2004
    #1
    1. Advertising

  2. Ryan Ternier

    Ryan Ternier Guest

    Hmm... The little elf reminded me to always flush after doing something
    dirty....
    It worked :D

    /RT
    "Ryan Ternier" <[no-spam]> wrote in message
    news:...
    > I'm writing a file out using StreamWriter. What i'm outputting is a 6,398
    > lines of stupid Jscript arrays.
    > Yes the system needs to be very very dynamic, and they don't want a page
    > reload.
    >
    > The arrays are so huge because the program needs:
    > Take table 1, and join each row in table 1 to X rows in Table 2.
    > Take each row in table 2 and assign it to X rows in table 3.
    > Take each row in table 3 and assign it to X rows in table 4... and so on.
    > ick.
    >
    > It runs the code, and writes the file, but only writes half of the file.
    > The stream getting output is over 300KB long.
    >
    > It might be that the string datatype is too short to hold all this
    > information so I switched:
    >
    > MyString &= "..."
    > to
    > objStreamWriter.WriteLine("...")
    >
    > This too only generates only half the file. It outputs about 120 KB of
    > data. Using another utility to create this file from the DB it makes it
    > 300 kb, and the code is Exactly the same.
    >
    > The stream writer hits every section of it. Even the closing </script>
    > tag, but the file gets cut in half.
    >
    > Here's how i'm declaring the stream writer:
    > -----------------
    > Dim objStreamWriting as new
    > System.IO.StreamWriter(objUtil.server.MapPath("/Classification.js",False)
    >
    > objStreamWriting.WriteLine("<script language=""JavaScript"">")
    > ....
    > For loop 1
    > ...
    > For loop 2
    > ...
    > For loop 3
    > ... inside this loop is where it will usually end. Around line # 2097
    > ...
    > objStreamWriting.WriteLine("</script>")
    >
    > objStreamWriting.Close
    > objStreamWriting = nothing
    >
    >
    > Anyone have any suggestions?
    >
     
    Ryan Ternier, Nov 25, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman

    Stream Writer

    Charles A. Lackman, Oct 18, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    8,621
    cg084
    Jan 16, 2008
  2. Guoqi Zheng

    missing CR LF with stream writer

    Guoqi Zheng, Jan 26, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    2,510
    Juan T. Llibre
    Jan 26, 2005
  3. JavaQueries
    Replies:
    1
    Views:
    3,695
    John C. Bollinger
    Mar 1, 2005
  4. DaVinci
    Replies:
    1
    Views:
    572
    Piotr Kobzda
    Oct 5, 2006
  5. Henri
    Replies:
    1
    Views:
    384
    Henri
    Jul 13, 2004
Loading...

Share This Page