Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String is not long enough
Message
From
05/02/2008 01:32:59
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01289423
Message ID:
01289433
Views:
10
>The string Length property is an int, which can be up to the max value of an int32, I believe (something like 2,000,000,000 characters)
>
>What are you trying to read in?

I was doing something like this:
lcXml = lcStreamReader.ReadToEnd()
lcXml is defined as a String. lcStreamReader is containing a dataset which has been converted into a XML and then to it. At that point, I already changed the code to use a string builder approach instead of lcXml. With the lcXml, this is giving me an OutOfMemory exception. I have about 7000 records which contain a lot of fields in that dataset. If I have a little less than that, I am not running into the OutOfMemory exception. With the change of code, I did not have the time to test if this will help so far.

Here is the ReadToEnd() stack:
at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
   at System.Text.StringBuilder.Append(Char[] value, Int32 startIndex, Int32 charCount)
   at System.IO.StreamReader.ReadToEnd()
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform