in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Modified on CF version

Last post 01-02-2007 7:46 PM by Robert Simpson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-21-2006 11:19 AM

    Modified on CF version

    I changed the dispose of connection like this:
     // Force any commands associated with this connection to release their unmanaged
            // resources.  The commands are still valid and will automatically re-acquire the
            // unmanaged resources the next time they are run -- provided this connection is
            // re-opened before then.
              while (_commandList.Count > 0)
              {
                  foreach (SQLiteCommand cmd in _commandList)
                  {
                      cmd.ClearCommands();
                      break;
                  }
              }

    This with this code the "foreach" of the dispose gave me an exception :
     using (cnn = new SQLiteConnection())
                {
                    try
                    {
                        cnn.ConnectionString = NxGeneral.CFGSOURCE;
                        string s = "......";
                        cnn.Open();
                        using (SQLiteCommand CM = new SQLiteCommand(cnn))
                        {
                            CM.CommandText = s;
                            SQLiteDataReader R = CM.ExecuteReader();
                            if (R.Read())
                            {
                                return R.GetString(0);
                            }
                            else
                            {
                                return "";
                            }
                        }
                    }
                    catch (SQLiteException s)
                   

                }
  • 12-22-2006 2:36 AM In reply to

    Re: Modified on CF version

    The correct change is
     foreach (SQLiteCommand cmd in _commandList)
                  {
                      cmd.ClearCommands();
                      if(_commandList.Count==0)
                        break;
                  }


    With this i do not have exceptions with the double "using"
  • 01-02-2007 7:46 PM In reply to

    Re: Modified on CF version

    This will be fixed in the next version.

    Robert

     

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems