I am trying to connect my MSTest Unit tests to Excel files (so that they can be data driven.)
I have tried using csv files and they work except when I need the values to be strings.
I would like to use Excel, but all of the connection strings have a Extended Properties='Excel xx.0;
where xx is a version number.
Where I work we have different versions of Office installed. I have 2013 and that is all, others have 2010 only.
Is there a Connection string to connect to excel as a data source without needing to use a specific version?
Here is an example of what I have tried that does not work:
[DataSource("System.Data.OleDB", @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=MyExcelFile.xlsx; Extended Properties='Excel 12.0;HDR=yes';", "Sheet1$", DataAccessMethod.Sequential)]