problem with connection state

2004-04-08
2004-05-13
  • Wilson Chan

    Wilson Chan - 2004-04-08

    it modify the test.cs file (uploaded to feature request section) and the error is that the connection state keep being "executing" so that I cannot perform another query.

     
    • Alexander Gavrilov

      reader.Close() must be called to release the connection and be able to use it again in the next ExecuteReader call.

       
    • Wilson Chan

      Wilson Chan - 2004-04-11

      I got it. each reader.close should be executed before cmd.executexxx

       
    • Nobody/Anonymous

      I have the same problem, but can't close the reader/command, eg:

      cmdA = "select * from table1"
      dsA = cmdA.executereader()
      do while dsA.read
         ' This next line causes an exception
         Dim cmdB As SQLiteCommand = _db.CreateCommand
         cmdB = "select * from unrelated_other_table"
         dsB = cmd.executereader()

      etc

      It apears that you can't have multiple command objects. Is this correct??

       
      • Alexander Gavrilov

        Are you sure that the creation of the command and not ExecuteReader causes an exception? You can create several commands from the same connection, but you can not have several opened DataReaders serving by the same connection. You must create a second connection, create the command from it and execute reader then.

         
        • Alexander Gavrilov

          OK. The version 0.14 supports several opened DataReaders from one SQLiteConnection. See the function TwoSimultaneousReaders in UnitTests/DataReaderTests.cs for example.

           

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks