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 505443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:35:57+00:00 2026-05-13T06:35:57+00:00

I am currently working on a project for traversing an excel document and inserting

  • 0

I am currently working on a project for traversing an excel document and inserting data into a database using C#.

The relevant data for this project is:

  • The excel sheet has 14 rows at the top that I do not care about. (sometimes 15, see Russia/Siberia below)
  • The data is grouped by name into 2 columns (date and value), such as:

Sheet 1

USA                        China                      Russia  
Date         Value         Date         Value         Siberia           
1/1/09       4.3654        1/1/09       2.7456        Date          Value        
1/2/09       3.5545        1/3/09       9.3214        2/5/09        0.2454
1/3/09       3.2322        1/21/09      5.2234        2/6/09        0.5557
  • The name I need to acquire is whichever is listed directly above “Date”.
  • I only care about data from dates we do not have in the database. Before each column set is parsed, I will acquire the max date for any given name from the database, and skip anything at or before it.
  • There is no guarantee that the columns will be in a constant order or have constant spacing.
  • I do not want data for all names, rather only those in a list I put together before the file is acquired.

My current plan is this:

  • For each column, if the date field is at row 16, save the name as the value in row 15 above it, check the database for the last date for that name, only insert data where the date is greater than the acquired date.
  • If the date field is at row 17, do the same thing, but start the for loop through each row at 18.
  • If the name is not in the list, skip the column. If it is, make sure to grab the column next to it for the necessary values.

My problem is:

  • I am currently trying to use the ExcelDataReader from Codeplex(http://www.codeplex.com/ExcelDataReader). This only likes csv-like sheets, which this project has not.
  • I do not know of any alternative Excel readers.
  • To the best of my knowledge, a straight FileStream traversal of this file can only go row-by-row, rather than column-by-column.

To anyone still reading, thank you for your time. Any recommendations on how to proceed? Please ensure that solutions can traverse each column, not each row.

Also, please don’t worry about the database stuff, or the list of names that precedes the traversal.

Addendum: What I’d really like to end up with is some type of table that I can just traverse with a nested loop, making column-centric traversal much, much easier. Because there is so much garbage near the top of the sheet (14+ rows), most simple solutions are not feasible.

  • 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-05-13T06:35:58+00:00Added an answer on May 13, 2026 at 6:35 am

    If you want to read from excel in C#, i’ve used this library with great success, it’ll give you the flexibility to parse columns/rows just however you’d like:

    • http://sourceforge.net/projects/koogra/ (read-only)

    Other open source libraries i haven’t used but could be good:

    • http://nexcel.sourceforge.net/ (read-only)
    • http://npoi.codeplex.com/ (can read and write)
    • http://developer.novell.com/wiki/index.php/Poi.Net (this project is dead)

    Alternatively, you can use one of the many good Java libraries, and convert it into a C# assembly using IKVM:

    • http://jxls.sourceforge.net/
    • http://www.andykhan.com/jexcelapi/
    • http://poi.apache.org/ (this one’s the grand-daddy of java XLS libraries)

    I’ve covered how to do the IKVM Java -> C# conversion here (it’s really not as horrible an option as you think):

    • http://splinter.com.au/blog/?p=207
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 383k
  • Answers 383k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the Windows Mixer API. I've found this article for… May 14, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer Yes WCF RIA services can support custom methods. You'd specify… May 14, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer Sure it is achievable using standard SQL syntax. Use GROUP… May 14, 2026 at 10:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.