I'm facing a problem with my console application. I want to read info from Microsoft Access database and display it on console. Here's the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OleDb;
using System.Data.Sql;
namespace _1_uzd
{
class Program
{
static void Main(string[] args)
{
string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;DataSource=\"studentu-db.accdb\"";
OleDbConnection con = new OleDbConnection(ConnectionString);
OleDbCommand cmd = new OleDbCommand("SELECT * FROM persona", con);
con.Open();
OleDbDataReader dataReader = cmd.ExecuteReader();
while (dataReader.Read())
{
Console.WriteLine(dataReader.GetInt32(0) + "\t" + dataReader.GetString(1) + "\t" + dataReader.GetString(2));
}
con.Close();
Console.ReadLine();
}
}
}
It should work but when I debug, the error message is shown: "OleDbExeption was unhandled. Could not find installable ISAM"...Where is the problem?
PS: I'm using Microsoft Access 2007, it that makes any sense,