Hello,
(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