I keep on getting this error when trying to use OleDb, and can't figure out how to solve the issue. I've tried referencing other websites and whatnot but got nothing. Here is what my code looks like:
OleDbCommand command = new OleDbCommand(@"SELECT [Name], [Config status], [OverallStatus], [NumHosts], [numEffectiveHosts], [TotalCpu], [NumCpuCores], [NumCpuThreads], [EffectiveCpu], [TotalMemory], [EffectiveMemory], [Num VMotions], [HA enabled], [Failover Level], [AdmissionControlEnabled], [Host monitoring], [HB Datastore Candidate Policy], [Isolation Response], [Restart Priority], [Cluster Settings], [Max Failures], [Max Failure Window], [Failure Interval], [Min Up Time], [VM Monitoring], [DRS enabled], [DRS default VM behavior], [DRS vmotion rate], [DPM enabled], [DPM default behavior], [DPM Host Power Action Rate] FROM [" + Sheet + "$]", conn); //Selects everything inside excel file
DataTable Data = new DataTable();
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
adapter.Fill(Data); //Puts all data inside a DataSet
The error occurs on the adapter.Fill(Data) line. Thanks for any help you may bring!
Edit: For further details, I am trying to pull data out of an Excel spreadsheet using OleDb, put that data into a DataTable object, and then use entity framework to push that data to a SQL server database. In my excel spreadsheet, the sheet I'm trying to access is named "vCluster". Could the issues lie in my OleDbConnection string?