Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem when convert 50MB string values to Stream... Pin
Ennis Ray Lynch, Jr.7-Aug-09 7:40
Ennis Ray Lynch, Jr.7-Aug-09 7:40 
GeneralRe: Problem when convert 50MB string values to Stream... Pin
harold aptroot7-Aug-09 8:10
harold aptroot7-Aug-09 8:10 
GeneralRe: Problem when convert 50MB string values to Stream... Pin
Ennis Ray Lynch, Jr.7-Aug-09 8:23
Ennis Ray Lynch, Jr.7-Aug-09 8:23 
GeneralRe: Problem when convert 50MB string values to Stream... Pin
harold aptroot7-Aug-09 8:42
harold aptroot7-Aug-09 8:42 
GeneralRe: Problem when convert 50MB string values to Stream... [modified] Pin
harold aptroot7-Aug-09 8:50
harold aptroot7-Aug-09 8:50 
GeneralRe: Problem when convert 50MB string values to Stream... Pin
Alaric_7-Aug-09 8:06
professionalAlaric_7-Aug-09 8:06 
AnswerRe: Problem when convert 50MB string values to Stream... Pin
Not Active7-Aug-09 2:54
mentorNot Active7-Aug-09 2:54 
AnswerRe: Problem when convert 50MB string values to Stream... Pin
Keith Barrow7-Aug-09 3:10
professionalKeith Barrow7-Aug-09 3:10 
I have to agree with Mark.

It looks like you've already loaded data into memory (in the guise of a StringBuilder), presumably from an IO stream. So I don'understand why you then perform a .ToString() then stream into memory.

If you are using a stream to populate the string builder it would be MUCH more efficent to process each line as you read it from source.


Additionally this stuff is asking for trouble:

while (true)
{
    string str = objReader.ReadLine();
    /*insert nested levels of logic which may or may not break here */
}


You have too many nested levels of code going on, making the code hard to read & understand and hiding any potential errors in the logic. I suggest you have a look into refactoring the code(Martin Fowler has written a book on this subject). Hopefully others will suggest more resources on this topic.
AnswerRe: Problem when convert 50MB string values to Stream... Pin
stancrm7-Aug-09 3:12
stancrm7-Aug-09 3:12 
AnswerRe: Problem when convert 50MB string values to Stream... Pin
Luc Pattyn7-Aug-09 3:42
sitebuilderLuc Pattyn7-Aug-09 3:42 
QuestionOpen new tab that not exist Pin
tamir9017-Aug-09 1:43
tamir9017-Aug-09 1:43 
AnswerRe: Open new tab that not exist Pin
Arindam Sinha7-Aug-09 1:58
Arindam Sinha7-Aug-09 1:58 
GeneralRe: Open new tab that not exist Pin
tamir9017-Aug-09 2:04
tamir9017-Aug-09 2:04 
GeneralRe: Open new tab that not exist Pin
Arindam Sinha7-Aug-09 3:20
Arindam Sinha7-Aug-09 3:20 
AnswerRe: Open new tab that not exist Pin
Moreno Airoldi7-Aug-09 2:13
Moreno Airoldi7-Aug-09 2:13 
GeneralRe: Open new tab that not exist Pin
Luc Pattyn7-Aug-09 3:45
sitebuilderLuc Pattyn7-Aug-09 3:45 
GeneralRe: Open new tab that not exist Pin
Moreno Airoldi7-Aug-09 15:18
Moreno Airoldi7-Aug-09 15:18 
GeneralRe: Open new tab that not exist Pin
Luc Pattyn7-Aug-09 15:40
sitebuilderLuc Pattyn7-Aug-09 15:40 
GeneralRe: Open new tab that not exist Pin
tamir90112-Aug-09 5:08
tamir90112-Aug-09 5:08 
GeneralRe: Open new tab that not exist Pin
Moreno Airoldi12-Aug-09 6:56
Moreno Airoldi12-Aug-09 6:56 
GeneralRe: Open new tab that not exist Pin
tamir90112-Aug-09 18:54
tamir90112-Aug-09 18:54 
GeneralRe: Open new tab that not exist Pin
Moreno Airoldi13-Aug-09 0:31
Moreno Airoldi13-Aug-09 0:31 
QuestionProblem to Export DataTable to Excel. Pin
hdv2127-Aug-09 1:10
hdv2127-Aug-09 1:10 
AnswerRe: Problem to Export DataTable to Excel. Pin
Tamer Oz7-Aug-09 1:37
Tamer Oz7-Aug-09 1:37 
GeneralRe: Problem to Export DataTable to Excel. Pin
hdv2127-Aug-09 2:28
hdv2127-Aug-09 2:28 

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.