Is there ant way to use Access 2016 database instead 2003 I was trying to access MS Access 2016 in VS 2017 but it was giving unrecognized database format. I want to know why it's happening as they both are among latest versions but it is working if we use access 2003 format instead 2016
I have used this question to solve the same problem
Unrecognized database format accdb in visual studio
Code to access database(Main Form):
private void ManageEmployeesForm_Load(object sender, EventArgs e)
{
LoadDataintoGridView();
}
private void LoadDataintoGridView()
{
EmployeesListdataGridView.DataSource = GetEmployeesList();
}
private DataTable GetEmployeesList()
{
DataTable dtEmployees = new DataTable();
string connString =
ConfigurationManager.ConnectionStrings["dbx"].ConnectionString;
using (OleDbConnection con = new OleDbConnection(connString))
{
using (OleDbCommand cmd = new OleDbCommand("SELECT * FROM
Mytabe",con))
{
con.Open();
OleDbDataReader reader = cmd.ExecuteReader();
dtEmployees.Load(reader);
}
}
return dtEmployees;
}
Connection string:(App.config)
<connectionStrings>
<add name="dbx" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data
Source = D:\Access Database\KaleemDatabase.mdb"
providerName="System.Data.OleDb"/>
</connectionStrings>
I am willing to use latest version but it is not working for latest version