I have an Excel file that has 4 known column headers and the rest will be Year/Month. The Year/Month column headers can be different in every file. There could be any number of these Y/M columns. In my WinForms application, the user will select an Excel file. What I need to figure out how to do is to take that Excel file, import it to a temporary table in my database, do some things, then delete the temp table. Everything I have seen is where you know what the columns will be ahead of time.
How can I accomplish this? Is it even possible?
I will try to be more clear. I have an excel file. The number of and names of the columns will vary(so I cant just create a temp table since I dont know what the fields are). I am taking that excel file and putting it into a local datatable in my application. I need to create a table on my sql database that mirrors that local database then copy the data there. So from my application how do I create a temp table on the mssql server.