Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Out of memory on loStringBuilder.ToString()
Message
From
07/06/2011 09:19:31
 
 
To
07/06/2011 00:52:36
General information
Forum:
ASP.NET
Category:
Troubleshooting
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01513090
Message ID:
01513325
Views:
52
>Can you post the code that solved your problem? I was going to suggest something along those lines, but didn't get far because, with the encoding you were doing with the StreamWriter, I didn't find an applicable overload with the FileStream ... and, unfortunately, I didn't have the time to investigate it further. Others might benefit from your solution.
            Dim loFileStream As FileStream = Nothing
            Dim loStreamWriter As StreamWriter = Nothing

            Try
                loFileStream = New FileStream(cFile, FileMode.Create)
                loStreamWriter = New StreamWriter(loFileStream, System.Text.Encoding.Unicode)

            Catch loError As Exception
                cMessage = oApp.StrTran(cCannotCreateFile, "##File##", cFile)

                ' If we log the error
                If lLogError Then

                    ' Get the proper definition as per the current scope
                    If oProcess Is Nothing Then
                        oApp.ErrorSetup(loError)
                    Else
                        oProcess.ErrorSetup(loError)
                    End If

                Else
                    Return False
                End If

            End Try

            ' Header
            loStreamWriter.Write("<?xml version=""1.0""?>" + oApp.cCR)

            ' Windows recognition
            loStreamWriter.Write("<?mso-application progid=""Excel.Sheet""?>" + oApp.cCR)

            ' Workbook
            loStreamWriter.Write("<Workbook xmlns=""urn:schemas-microsoft-com:office:spreadsheet"" " + oApp.cCR)
            loStreamWriter.Write("xmlns:o=""urn:schemas-microsoft-com:office:office"" " + oApp.cCR)

            ...

            loStreamWriter.Close()
            loFileStream.Close()
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