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

  • SEARCH
  • Home
  • 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 8337843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:24:42+00:00 2026-06-09T04:24:42+00:00

Here is the story: I want to import an excel sheet into a database.

  • 0

Here is the story:

I want to import an excel sheet into a database.
I do some preparations on the client, like selecting the file, the correct sheet and the configuration of the sheet.

When that’s all done I send the file to my local wcf server.
Then wcf writes the file to the temp folder (C:\Windows\Temp).
I create an oledb connection and execute a count(*) command on the sheet, and that is where it goes wrong.

The code:

            _connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FileName + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");
            OleDbCommand command = new OleDbCommand("SELECT COUNT(*) FROM [" + .SheetName + "]", _connection);
            if (_connection.State == ConnectionState.Closed)
                _connection.Open();
            TotalRows = (int)command.ExecuteScalar();

Yes, I’m not using a using here, don’t mind that please…
When (int)command.ExecuteScalar(); is executed it goes wrong.
I receive the error: System resource exceeded.. This is an OleDBException.

The memory of my computer ain’t being filled and it looks like it doesn’t even try to read the file. It instantly crashes.

Some information about the file I try to read:

  • It has 154k rows
  • It has 114 columns
  • The size is 90mb

If I take a subset of 50k rows of this, it doesn’t crash.
Though it says that TotalRows is 2536.
At first I though the file was corrupt, but thats not the case since this exact same code works on the client with the exact same file.

If I take a subset of 2500 rows all goes well and there are now problems.
If I take a subset of 2600 rows (doesn’t matter which rows) the row count is still 2536.

My questions:

  • What is going wrong?
  • Who is responsible for the error and the incorrect results?
  • Why does it work on the client, but not on my server (same machine!)
  • Why doesn’t it crash with a smaller file?

Need more information? Please leave a comment.

Update 1:
Both the client and the server run as 32 bit applications.

  • 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-09T04:24:43+00:00Added an answer on June 9, 2026 at 4:24 am

    Have the same problem. I am trying to read excel file with 30k rows via web site.
    But I only take a subset of 8007 rows.
    I found that if I change Application Pool Identity to Administrator instead of Network service then all is ok. Also if I converted my excel file to .xls Jet Provider can read 30k rows too.

    Then I look through the forums and found that and try my code with ExtendedProperties parameter IMEX=1 and all 30k rows was read.

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

Sidebar

Related Questions

I have data from an Excel spreadsheet that I want to import into a
I want to put some compressed data into a remote repository. To put data
i want to store images in \mnt\sdcard package com.Downld_file_frm_net; import java.io.BufferedInputStream; import java.io.File; import
I want to store some Hindi words in a MySQL database. For that I
So here is my problem. I want to store 2-tuple (key, val) and want
Here's the story... I have a jQuery function that does something, this function is
Here's the story. I created an interface, IVehicle . I explicitly implemented the interface
Right, here's the story: We have had a website for one of our brands
Lately, I'v been struggling with an annoying situation on ASP.NET MVC. Here's the story
This is an extension of a question I previously asked here . Long story

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.