A way to easily manipulate data from an excel spreadsheet programmatically
I work in an office environment which is dominated by Microsoft Excel spreadsheets, and so often, people want to use them in programs. I am a SQL junky myself, but Excel is appropriate in a lot of cases, but integrating them into programs can be a pain. More specifically, getting the data from the Excel worksheet to a form where it is workable can be a pain.
With this example, you can see how to take in an Excel Spreadsheet to get the data into commonly manipulatable data types in c#; then you can use/change it however you want to. This demo shows first how to put the data into a dataset, then datatable (almost the same thing), then takes the same data in puts it into a multi-dimensional array (I prefer to work it arrays). Since this is a linear progression, the demo only outputs the information from the array into an html table to show that it worked.
The demo uses the very first row as the column names (as it is used in datatable) and assumes that the Spreadsheet is in default format with Sheet1 as it's first sheet. The demo only processes Sheet1. This can be easily customized if you want to process more.
With this, you can take/change/display the excel data however you want to using asp.net controls like ListView or GridView or just simple c#. The code is pretty well commented, so you should be able to pull the parts that you may need. *NOTE: you need full trust enabled for this to work properly.