Giter Club home page Giter Club logo

sql2xls's People

Contributors

swidz avatar swidzsii avatar

Stargazers

 avatar

Watchers

 avatar

sql2xls's Issues

System.OutOfMemoryException when generating excel with SAX from very large sql result

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
at System.Xml.XmlUtf8RawTextWriter.WriteAttributeTextBlock(Char* pSrc, Char* pSrcEnd)
at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
at System.Xml.XmlWellFormedWriter.WriteString(String text)
at DocumentFormat.OpenXml.OpenXmlPartWriter.WriteStartElement(OpenXmlElement elementObject, IEnumerable1 attributes, IEnumerable1 namespaceDeclarations)
at Sql2Xls.Excel.Adapters.ExcelExportSAXAdapter.CreateSharedStringCellSAX(OpenXmlWriter openXmlWriter, Int32 columnIndex, Int32 rowIndex, String value, UInt32 styleIndex, Boolean isValueSharedString) in D:\projects\Sql2Xls\src\Sql2Xls\Excel\Adapters\ExcelExportSAXAdapter.cs:line 422
at Sql2Xls.Excel.Adapters.ExcelExportSAXAdapter.CreateSheetDataSAX(OpenXmlWriter openXmlWriter, DataTable dataTable) in D:\projects\Sql2Xls\src\Sql2Xls\Excel\Adapters\ExcelExportSAXAdapter.cs:line 333
at Sql2Xls.Excel.Adapters.ExcelExportSAXAdapter.CreateWorksheet(SpreadsheetDocument document, WorksheetPart worksheetPart, DataTable dataTable) in D:\projects\Sql2Xls\src\Sql2Xls\Excel\Adapters\ExcelExportSAXAdapter.cs:line 298
at Sql2Xls.Excel.Adapters.ExcelExportAdapter.CreateFromDataTable(SpreadsheetDocument document, DataTable dataTable) in D:\projects\Sql2Xls\src\Sql2Xls\Excel\Adapters\ExcelExportAdapter.cs:line 204
at Sql2Xls.Excel.Adapters.ExcelExportAdapter.LoadFromDataTable(DataTable dataTable) in D:\projects\Sql2Xls\src\Sql2Xls\Excel\Adapters\ExcelExportAdapter.cs:line 96
at Sql2Xls.Sql2XlsService.CreateDocument(String datasetName, String sqlCommand, String outputFile, Sql2XlsServiceParameters parms) in D:\projects\Sql2Xls\src\Sql2Xls\Sql2XlsService.cs:line 181
at Sql2Xls.Sql2XlsService.ProcessTask(Sql2XlsTaskData taskData, Sql2XlsServiceParameters parms) in D:\projects\Sql2Xls\src\Sql2Xls\Sql2XlsService.cs:line 135

Remove call in Sql2XlsService to GetAccessControl in CheckWriteAccessToFolder method (Linux compatibility isues)

private bool CheckWriteAccessToFolder(string folderPath)
{
  try
  {
      // Attempt to get a list of security permissions from the folder. 
      // This will raise an exception if the path is read only or do not have access to view the permissions. 

      var di = new DirectoryInfo(folderPath);
      DirectorySecurity ds = di.GetAccessControl();
      return true;
  }
  catch (UnauthorizedAccessException)
  {
      return false;
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.