Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i save very lager characters in string value by for loop
(take from data base)


but when the record be very lager
say for me

Out Of Memory

how i can increase this memory ??
is in VB.Net have variable larger than String ?


this simple of code (as code)

VB
Dim strTbl1 As String
For i As Integer = 0 To objNodeLang.ChildNodes.Count - 1
	strTbl +=  TextLang 
Next
strTbl =  strTbl.ToString



if strTbl.ToString be more than about 28888000 character
do error and till me
"Out Of Memory Exception"

so i use this to fix it

VB
Dim strTbl1 As String
For i As Integer = 0 To objNodeLang.ChildNodes.Count - 1
    strTbl +=  TextLang
    If strTbl.Length > 2500000 Then
        strTbl1 = strTbl
        strTbl = ""
    End If
Next
strTbl = strTbl1.ToString + strTbl.ToString&lt;/pre&gt;</pre>



but its not good idea
plez help me
Posted
Updated 17-Nov-13 19:55pm
v3
Comments
OriginalGriff 17-Nov-13 7:45am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Try showing us the code you use to generate the string.
Use the "Improve question" widget to edit your question and provide better information.
Mike Meinz 17-Nov-13 7:50am    
If you are getting out of memory errors when putting data into a String data type, the most likely cause is a problem with the design of your software. Perhaps if you showed some actual Visual Basic source code, we might be able to point out the issue. Please use the Improve Question link above to enhance your question with your actual Visual Basic source code.
Dave Kreskowiak 17-Nov-13 10:58am    
Without showing your code, it's impossible to tell you what's wrong.

But, as a general rule, you cannot have any object in .NET larger than 2GB in size.
Bernhard Hiller 18-Nov-13 3:13am    
What do you do with such a big string? Who will read its contents? Go back to the requirements, and think again how you could solve them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900