For access to the Excel spreadsheet you can use
EPPlus[
^]
SQL Server Management Objects [
^] provides an easy to use API for accessing meta information, such as column names.
The
Database.Tables[
^] property provides access to the tables in the database, and the Table class has a
Columns[
^] property that you can use to access each
Column[
^] of the table in question.
You can then compare the
Name[
^] of the column against the column name from the Excel spreadsheet.
Best regards
Espen Harlinn