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 <sql...@mistachkin.com> 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