Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:01:14+00:00 2026-06-05T23:01:14+00:00

I created an intranet system to handle TXT files in a directory and process

  • 0

I created an intranet system to handle TXT files in a directory and process it’s data into a SQL Server database. It’s recursive, so I have a file structure like this:

C:\RawData\2012_06_01\2012_06_01_0002144493.txt
C:\RawData\2012_06_01\2012_06_01_0002954412.txt

…

C:\RawData\2012_06_15\2012_06_15_0012554778.txt

And so on, summing up to about 10.530 files.

It works perfectly when selecting just some folders (like all folders from a month).
However, when trying to process, let’s say, an year of files (from 2011_06_01 to 2012_06_01), it begins processing, and then I get this ERR_EMPTY_RESPONSE error.
It is not connection related, since it happens under VS2010 engine (I just run the code, it opens the browser, I select all folders I want – on the web interface – and click “process” button).

The processing is being made by doing loops under loops, like this sample:

string[] folders = Directory.GetDirectories(parentFolder);
foreach (string folder in folders)
{
    string[] files = f.GetFilesRecursive(@folder);
    foreach (string file in files)
    {
        if (File.Exists(file))
        {
            string buffer = "";
            StreamReader sr = File.OpenText(file);
            while (!sr.EndOfStream)
            {
                string line = sr.ReadLine();
                buffer += line;

                // All the internal file processing and database calls goes here

            } // while
            sr.Close();
        } // if file exists
    } // foreach (files)
} // foreach (folders)

This code is a simplified version of the original code. The internal file processing code is really big, involves classes, database objects, etc. but they’re working fine (with few files, up to 300 files or so, it works flawlessly).

Is there a way to avoid this error, or any suggestion about other ways to optimize file processing?

Also (and of minimum importance), I would like to implement an ajax response, so the user could see a percentage bar or something like that… I’ve heard about ICallbackEventHandler and IPostBackEventHandler, but I have no idea on how implement this under loops like this one I use.

Anything would really be appreciated.

EDIT ON 2012-06-21:

I found the answer.
The solution suggested by @BumbleBee gave me a start point for researching, since it returned the message:

Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.

Found this: ASP.NET true asynchronous operation
which has the solution on a link in the answer post ( ThreadPool.QueueUserWorkItem uses ASP.Net )

Now, I just need to find a way to send data using AJAX to 3 Divs on page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:01:15+00:00Added an answer on June 5, 2026 at 11:01 pm

    You might want to change the RequestTimeout and see.

    <httpRuntime executionTimeout="some big value here"  />
    

    Check this for an example

    But that actually isn’t the real fix for your problem. You need to fire up a background thread and let it handle the big processing and let the UI thread return with a message to the user. Here is one example how you could achieve that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a web enabled database using SQL Server 2005 to store the data
I have created a new SharePoint 2007 MOSS Intranet. Our admin people are purchasing
I have a new MVC application which integrates into a larger pre-existing intranet site.
I have created some PHP-based intranet resources that require users to log in. The
I have created a small survey web page on our company Intranet. This web
I have created an activex control that will be used only for our intranet.
1) i have a server hosting web page ( intranet ) . Intent is
We've created an intranet site that requires the same password as the user's network
Here's our scenario: We've created a sharepoint 2007 calendar on our intranet site We
Created .NET WCF service, tested it - works. Generated schemas from Data and service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.