So the following C# code contain the code that I use to check my database connection. Not sure whether it's the correct way or not but I seems to always get the:
" System.InvalidOperationException: 'The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine'
Any idea how to fix this? btw I'm currently using VS2017 and Excel 2016
try{
string connectString = "Provider = Microsoft.ACE.OLEDB.12.0;Data Source =C:\\Users\\user\\Desktop\\Book1.xlsx;Extended Properties=\"Excel 16.0 XML;HDR=Yes;\"";
OleDbConnection xlConnection = new OleDbConnection(connectString);
xlConnection.Open();
MessageBox.Show("Success");
}
catch(OleDbExceptionEx ex)
{
MessageBox.Show(ex.Message);
}