1. An ASP.NET website encountered the following error, and the failing page had a database update operation for modifying click-through rate (the code itself had no programming errors):
string strSql="UPDATE reference SET hit=hit+1 WHERE id="+i;
2. The error message is as follows:
System.Data.OleDb.OleDbException: Operation must use an updateable query. at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&
executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at DDRS.FaqDetail.UpdateHit(Int32 i) in
d:/wwwroot/LG_vrd/FaqDetail.aspx.cs:line 64
3. Cause of the Fault: The database was not granted sufficient permissions.
4. Solution: Grant read and write permissions, as shown in the images below.
A. Before granting permissions:
B. After granting permissions: