Library used incorrectly

2007-03-22
2013-04-15
  • Hi, I would just like to say well done to the contributers of this project. (I've also posted this at http://sqlite.phxsoftware.com/forums/thread/3111.aspx\)

    I am trying to implemented the standard website login using ASP.NET Visual studio 2005.  Following this article. http://www.eggheadcafe.com/articles/20051119.asp
    So far so good, users can logon etc. I want to allow the admin user to be able to edit the user table to view and edit the User's table.

    I have installed the Provider , added a SQLDataSource, I auto generated the Update, Delete commands. I added a GridView to the form and pointed it to the DataSource. The data is viewable but updating or deleting data causes error message below.

    Does anyone know what is going on?
    If not can anyone think of a handy way of viewing editing/deleting User accounts?
    Thanks in advance. Kevin.

    Library used incorrectly
    library routine called out of sequence
    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.SQLite.SQLiteException: Library used incorrectly
    library routine called out of sequence

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SQLiteException (0x80004005): Library used incorrectly
    library routine called out of sequence]
       System.Data.SQLite.SQLite3.Bind_Text(SQLiteStatement stmt, Int32 index, String value) +193
       System.Data.SQLite.SQLiteStatement.BindParameter(Int32 index, SQLiteParameter param) +780
       System.Data.SQLite.SQLiteStatement.BindParameters() +74
       System.Data.SQLite.SQLiteCommand.BuildNextCommand() +360
       System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index) +37
       System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() +48
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +401
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +721
       System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
       System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1215
       System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +858
       System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
       System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +117
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

     
    • Please note that the project http://sourceforge.net/projects/sqlite-dotnet2 is different from this one!
      This ADO.NET Data Provider (https://sourceforge.net/projects/adodotnetsqlite/) is currently inactive!

      I suggest moving to the newer and active one (sqlite-dotnet2). It has more features and is much more stable!

      (btw: The error is generated when SQLite functions are called in the wrong order and I believe when calling from different threads - Move to the newer one!)