jeudi 17 septembre 2015

Compare DataTable list to String List

So I am trying to create data tables from an excel import to then be used for other things. I know the names of the spreadsheet sheets so I have created my datatables at the top of my document:

private DataTable Version,Pi_PROCESSPi_PMLIFEPROFILE,PIAPPLICATION,PIRUGGEDISING,ELECTRONICCOMPONENT,HFANDRFCOMPONENTS,HYBRIDANDMULTICHIPMODULE,COTSBOARDS, VARIOUSSUBASSEMBLIES,PARTCOUNT, FAMILYCOUNT; 

I then have a list and a for loop when the spreadsheet is read that assigns the spreadhseet names to that list

List<string>ExcelSheets = new List<string>();

The excel spreadsheet list and the datatable declarations have the same name

I have a function that reads the excel spreadsheet based on the given sheet name so I want to be able to do something like (pseudo-code) :

foreach ExcelSheets{
Datatable = dt.ReadFunction()
}

With DataTable being the declared datatables at the top of the file.

So I want to say for each Sheet in the list, run the function and assign the result to the corresponding datatable





Aucun commentaire:

Enregistrer un commentaire