我遇到以下问题,在尝试将新记录插入Access数据库时,我得到“必须使用可更新的查询”。
代码是:
OleDbConnection Conn = new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=Checkbook.accdb;");
string SQL = "Insert into Category (CategoryDescription) values('Pizza')"
OpenDatabase(); //This does a Conn.Open();
OleDbCommand myAccessCommand = new OleDbCommand(SQL, Conn);
myAccessCommand.ExecuteNonQuery();
CloseDatabase();