Re: [sqlite] cannot set connection while a datareader is active

2014-04-21 Thread rava
I know, you have all code wich is involved in the error... for the parte 
involved, no other function was called... i call executereader only for one 
datareader and two Times directly to the command... do you found the other 
datareader in the sent code? If exist it have to be in the sent code, but i 
don't see nothing..  you could?

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> Thanks for answer Joe, but as just sayed i have only one datareader,
>>
>
>That is not possible.  There must be at least two different data reader
>instances because the references in the watch window did not match.
>Every time you call ExecuteReader, a brand new data reader is returned.
>Keeping track of these returned data readers is very important because
>they must all be properly disposed at some point.
>
>>
>> i'm sure of that, and this is demostrated because with others provider
>> i have not error.
>>
>
>Perhaps the other providers do not have a restriction on resetting the
>underlying connection for a command when data readers are active.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cannot set connection while a datareader is active

2014-04-21 Thread rava
Thanks for answer Joe, but as just sayed i have only one datareader, i'm sure 
of that, and this is demostrated because with others provider i have not error.
Try please changing the first lines of code in frmprincipale.vb form as 
explained for match access database... you Will not have error... why this if 
not a provider error? 
Otherwise, what have i to do in tour mind? Thanks

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> i've built a very little application wich could reprocude the "CANNOT SET
>> CONNECTION WHILE DATAREADER IS ACTIVE" error.
>> 
>
>I've run the project with Visual Studio 2013 and determined that the
>exception
>being raised is almost certainly not an issue with System.Data.SQLite, per
>se.
>
>At the point of the exception, I used the following watch expression:
>
>   
>DirectCast(objCmd,System.Data.SQLite.SQLiteCommand)._activeReader.Target Is
>Dati
>
>This returns false, indicating that while the SQLiteCommand object does
>indeed
>have an active data reader, it is NOT the one that was closed just above
>that
>point in the code.  I'm not sure how the project manages data reader
>instances;
>however, it would appear that System.Data.SQLite is throwing exceptions just
>as
>it should in this case.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cannot set connection while a datareader is active

2014-04-16 Thread rava
Ops... i'm not able to do this, never used first and don't know c# so well to 
understand the project. Can i try somes others way from my project??
Have you idea about why with the same code the sqlite provider is the only wich 
give me this error? Could depend from a query ? But i don't obtain visible 
error passing query from a gui database external software, just tested ... 

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>> 
>> Joe i cannot find the way for follow the command object properties you 
>> saycould you tell me what and how to observe exactly please ? 
>> 
>
>You might need to add the System.Data.SQLite project(s) to the solution in
>order
>to be able to see full debugging information for them.
>
>I recommend adding the "System.Data.SQLite.20XX.csproj" and
>"SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of
>Visual
>Studio you are using.
>
>Then, you'll want to reset the reference to point to the project instead of
>the
>built assembly.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cannot set connection while a datareader is active

2014-04-15 Thread rava
How could i do this? By debugging and adding a watch to the object?

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> So what have i do? Need to see others setting or state?
>> 
>
>It would be useful to try and examine the internal state of the
>SQLiteCommand and see if the _activeReader member is valid.  If
>it is valid, see if it actually refers to the data reader you
>are using.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cannot set connection while a datareader is active

2014-04-14 Thread rava
So what have i do? Need to see others setting or state? If yes how? Could be a 
problem solved with a New compilation of dll? The strange thing is it happen 
sometimes in one passage, sometimes in another of proposero function. Could be 
generated by execution of particular sql query with date field? 

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> Can i send you a screenshot where you could see with your eyes my debug 
>> situation ? So you could observe it cannot say there is a datareader 
>> active and in the same time show that datareader is closed...
>> 
>
>I've seen the screenshot; however, it does not show the internal state of
>the SQLiteCommand object throwing the exception.  When the Close() method
>of the SQLiteDataReader is called, it should end up calling ClearDataReader
>on the associated SQLiteCommand.  In this case, that may not be happening.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cannot set connection while a datareader is active

2014-04-14 Thread rava
Thanks for answer. Today i'll try to update my code as you say and i'll 
feedback the result.
However i don't think is a solution because just tried to use a line of code 
simplest as possibile,like only "datareader.close()" but still not work.
The error is catched not during datareader close method, but after, when i call 
"objcommand.connection equal objconnection"... here start error, but debugger 
say datareader isclosed as in attached image i sent ...(but where is the 
attached image i sent??? I don't see today)

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> Hello Joe, here my code for CloseDati to help you to reproduce the error 
>> that i don't understand...
>> 
>> ++
>> Public Sub CloseDati()
>> 
>>  'chiude i dati del datareader associati all'oggetto DATI cui
>>  ' spesso sono attaccati anche altri oggetti come
>>  ' l'oggetto ObjCmd
>>  Try
>>  If IsNothing(Dati) = False Then
>>  If Dati.IsClosed = False Then Dati.Close()
>>  End If
>>  Catch ex As Exception
>>  Call ScriviLog("ModConnessione.CloseDati", ex.Message)
>>  MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf
>& vbCrLf & ex.Message)
>>  End Try
>>  End Sub
>> 
>> Just seen the image attachment i sent which demostrate i obtain the error
>?
>> 
>
>I'm still unable to reproduce the issue.  Is an exception being caught by
>this
>method while trying to close the data reader?  Also, perhaps instead of
>using
>the IsNothing function, you might want to change the "If" expression to:
>
>   If Not Dati Is Nothing Then
>
>In theory, changing the "If" expression should not make any difference;
>however,
>I seem to recall that the IsNothing function was typically used for checking
>the
>sub-type of a Variant (i.e. and not for checking for null references).  Of
>course,
>I have not used Visual Basic.NET for quite a long time and I may be wrong.
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [sqlite-dev] Final preparations for the releaseof System.Data.SQLite v1.0.92.0 have begun...

2014-03-17 Thread rava
Thank you Joe, today i Will try if work in my intentions and i'll feedback to 
you

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> If yes, i like this way! When could i try the compiled version for make
>somes tests? 
>>
>
>Here is a temporary set of debug binaries for the .NET Framework 4.0 (or
>higher):
>
>https://system.data.sqlite.org/temporary/System.Data.SQLite-StickyHasRows-59
>fcdb.zip
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [sqlite-dev] Final preparations for the release of System.Data.SQLite v1.0.92.0 have begun...

2014-03-17 Thread rava
Hello and thanks for reply ...
You want say i have just to add " Flags=StickyHasRows;" to normal string 
connection and i could use hasrows in the way i say? 

If yes, i like this way! When could i try the compiled version for make somes 
tests? 

Joe Mistachkin  ha scritto:

>
>Stefano Ravagni wrote:
>>
>> In addiction..what change in backward compatybilities ? I think nothing...
>> Who use datareader with "while .read do " continue to use in same 
>> waybut many others developer, who use HasRows for check if 
>> datareader has or had records will be gratified to this new 
>> capacity...don't think ??
>>  
>
>I have figured out a backwards compatible way to enable this behavioral
>change.
>
>It involves modifying the connection string used when creating the
>associated connection by modifying [or adding] the Flags connection
>string property to include the StickyHasRows value, e.g.:
>
>   "Data Source=:memory:;Flags=StickyHasRows;"
>
>Currently, these changes can be seen on the stickyHasRows branch, here:
>
>   https://system.data.sqlite.org/index.html/timeline?r=stickyHasRows
>
>Would this satify your requirements?
>
>--
>Joe Mistachkin
>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users