Click to See Complete Forum and Search --> : Operation must use updatable query


skid_myanmar
October 5th, 2005, 10:49 AM
Hi gurus,
Please explain me about it and tell me how to correct

Server Error in '/DetailUsageViewer' Application.
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

Source Error:

Line 18: com.CommandType = CommandType.Text;
Line 19: con.Open();
Line 20: com.ExecuteNonQuery();
Line 21: con.Close();
Line 22: label.InnerText="OK";


Source File: d:\inetpub\wwwroot\DetailUsageViewer\testasp1.aspx Line: 20

Stack Trace:

[OleDbException (0x80004005): Operation must use an updateable query.]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +67
ASP.TestAsp1_aspx.Page_Load(Object sender, EventArgs arg) in d:\inetpub\wwwroot\DetailUsageViewer\testasp1.aspx:20
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Shuja Ali
October 5th, 2005, 10:54 AM
Seems like something is wrong with your query. Post the source code that is giving you error. My immediate guess would be that com.ExecuteNonQuery() is giving an error.

mmetzger
October 5th, 2005, 03:44 PM
Take a look at the following:

http://support.microsoft.com/kb/q175168/

jhammer
October 5th, 2005, 04:12 PM
I once got this exception when the database was read-only (Access). Making it writable again solved the problem.

skid_myanmar
October 5th, 2005, 11:47 PM
Thanks everybody,
I attached three sample files I used...
If you can run without error, then my machine may be wrong...
If you can't also run, then my code may be wrong...