Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET stream writer problem

Reply
Thread Tools

ASP.NET stream writer problem

 
 
Ryan Ternier
Guest
Posts: n/a
 
      11-25-2004
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?


 
Reply With Quote
 
 
 
 
Ryan Ternier
Guest
Posts: n/a
 
      11-25-2004
Hmm... The little elf reminded me to always flush after doing something
dirty....
It worked

/RT
"Ryan Ternier" <[no-spam](E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what' wrong with my simple codes on reader/writer problem ,the writer thread never run DaVinci Java 1 10-05-2006 07:42 AM
Problems with Cdrom and DVD writer and CD writer Combo reachinout Computer Support 1 09-20-2004 10:02 PM
Isn't DataGrid.Render(writer) supposed to automatically call RenderBeginTag(writer) and RenderEndTag(writer)? Henri ASP .Net Building Controls 1 07-13-2004 10:27 PM
CD writer and Dvd writer problem Gareth not NLL or anybody else. Computer Support 3 04-28-2004 12:41 PM
Replacing CD writer with DVD writer zebu Computer Support 5 04-12-2004 03:04 AM



Advertisments