I'm having difficulty manipulating an Access 2007 database. My code is this:
using (OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\User\\db.accdb;Jet OLEDB:Database Password=" + password + ";Persist Security Info=False"))
{
connection.Open();
string query = "INSERT INTO Book(Name, Author) VALUES('Hello', 'World')"; ;
OleDbCommand cmd = new OleDbCommand(query, connection);
cmd.ExecuteNonQuery();
connection.Close();
}
Why can't I write the record to the table of that database? How can I view the cell of the record?