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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:42:53+00:00 2026-05-16T22:42:53+00:00

(finally) I was able to read a Excel file located in the App_Data folder

  • 0

(finally) I was able to read a Excel file located in the App_Data folder and display it on a view. Now I’d like to push the logical further. Instead of writing the following header tags on my page by hand,

<tr>
    <th>ID</th>
    <th>First Name</th>
    <th>Last Name</th>
</tr>

I’d like to be able to read the first row on my Excel Sheet and, through a foreach loop, recreate the header on the page. Or, if there’s a different way of getting the header differently, I’m open.

How do I do that?

EDIT

Here’s the connection string

<add name="xls"
     connectionString="Provider=Microsoft.ACE.OLEDB.12.0;
                       Data Source=|DataDirectory|Book1.xlsx;
                       Extended Properties='Excel 12.0 Xml;HDR=YES';" 
/>

Thanks for helping

  • 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-16T22:42:54+00:00Added an answer on May 16, 2026 at 10:42 pm

    We do this using the Open XML SDK http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

    It allows you to read an excel sheet as an xml document.

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

Sidebar

Related Questions

I'm finally able to get an Access Token, now I'm very confused as how
I recently ran across this puzzle, was finally able to struggle out a hacky
Edit2: After finally being able to profile the two against each other, it appears
I finally let windows nag me into upgrading from IE6 to 8. Now in
I finally got my localhost to display the site locally. Everything seems to be
I have a php file that can read the contents of other files perfectly
Finally i tried to draw a line using OpenGL ES framework in XCode 4.2
Finally deployed my ruby on rails 3.2 app but when trying to open it
Finally figured it out thanks to One Mad Monkey, but forgot quotes on my
Finally I managed to get pylucene working on my windows7 machine, Which raised a

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.