CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    155

    Operation must use updatable query

    Hi gurus,
    Please explain me about it and tell me how to correct
    Code:
    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
    Life Is Nothing But One's Belief
    Don't Forget That All People Are Waiting For Your Reply
    If you're pleased the answer, at least you should say "Thanks"

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Operation must use updatable query

    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.

  3. #3

    Re: Operation must use updatable query

    Take a look at the following:

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

  4. #4
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Operation must use updatable query

    I once got this exception when the database was read-only (Access). Making it writable again solved the problem.

  5. #5
    Join Date
    Nov 2004
    Posts
    155

    Re: Operation must use updatable query

    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...
    Attached Files Attached Files
    Life Is Nothing But One's Belief
    Don't Forget That All People Are Waiting For Your Reply
    If you're pleased the answer, at least you should say "Thanks"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured