Connection to a huge database CSV

2017-04-30

Not so long ago in FastReport .NET was added the ability to load data from a csv file. In other words, a CSV file can now be used as a data source.

This was done after some time from one of the users entered an interesting query to a support. He claimed that he has a CSV file that does not open, instead, an error message appears. The user kindly provided this file for testing.

At first glance, it was thought that the file too is big, that is the reason why it can not be opened. But upon further examination it was revealed that the problem is not in the size of the file. As it turned out, the file does not entirely correspond to the CSV specification. In the file rows were found that did not contain separators. Apparently, they are used as comments, with any data yourself.

It was decided to ignore such lines when data is loaded. As a result file has become loaded without any problems.

It would seem that the problem is solved and we can settle down, but the idea of a large csv file did not give a rest. After some searching there was found a really huge file. This file size was 441 MB, seemingly not very awesome, but, nevertheless, it consisted of 31 columns and 2 458 525 lines.

Testing this download brought dual results. On the one hand, the file opens that undoubtedly pleased. But it was a very sad fact that the file download took nearly half an hour.

It is known two solutions to this problem. However, buying a new computer is not a good idea. Therefore, I had to spend some time to optimize the code. As a result, the file download has been achieved within two minutes

.NET .NET FastReport FastReport CSV CSV
March 25, 2025

How to Merge Multiple Reports into One in FastReport .NET

FastReport .NET is a powerful tool for creating and managing reports. In this article, we will look at how to combine multiple reports into one in FastReport .NET.
March 11, 2025

How to Use FastReport .NET Avalonia on Fedora Workstation with Wayland Protocol

In this article, we will discuss how to run FastReport .NET Avalonia on the "Fedora Workstation 39" operating system with Wayland protocol.
March 07, 2025

How to Create a QR Code with an Image in FastReport .NET

The article figured out how to insert a picture into a QR Code from the report designer FastReport.NET in just a couple of clicks.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.