So I removed all referenced to version 1.0.96.0 and added in version 1.0.60.0 currently being used in production for the .Net 2.0 version of the application. So far I have not seen the errors. So it appears to be an incompatibility issue between the later version of System.Data.Sqlite and the old generated dataset code for .net 2.0 in a .net 4.5 application. Is it possible to get versions of Sqlite between 1.0.60.0 and the latest release so I can try to isolate where the issue starts?
Steve -----Original Message----- From: [email protected] [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Steven M. McNeese Sent: Friday, April 24, 2015 10:30 AM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Upgraded 1.0.60.0 to 1.0.96.0 Thanks for the reply Joe. I am just confused at what could be different between the two version of the data provider or two version of .Net. Something has changed that is causing this because it was not user code. Since the project was migrated from .net 2 to .net 4.5, I suspect it is has to do with the way the dataset objects were created by the old Visual Studio. I am going to try the .net 4.5 version with the 1.0.60.0 to see if the same issue is happening and then work from there. I am not sure what happens behind the scenes with the .net dataset classes but I would imaging they are wrapping in a Using statement. Those objects are not getting destroyed so the connection should not be disposed. Steve -----Original Message----- From: [email protected] [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Joe Mistachkin Sent: Friday, April 24, 2015 10:23 AM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Upgraded 1.0.60.0 to 1.0.96.0 Steven M. McNeese wrote: > > I upgraded an old .net 2.0 application using System.Data.Sqlite v > 1.0.60.0 to .net 4.5 using system.data.sqlite v 1.0.96.0. The > application started getting random exceptions when access the database > using datsets. See > below: > The only time that ObjectDisposedException will be thrown is when an attempt is made to actually make use of a disposed object, including connections, data readers, and commands. For those objects, a "using" statement is typically the safest way to make use of them, e.g.: using (SQLiteConnection connection = new SQLiteConnection( "Data Source=test.db;")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { command.CommandText = "CREATE TABLE t1(x);"; command.ExecuteNonQuery(); command.CommandText = "INSERT INTO t1(x) VALUES(1);"; command.ExecuteNonQuery(); command.CommandText = "INSERT INTO t1(x) VALUES(2);"; command.ExecuteNonQuery(); command.CommandText = "SELECT x FROM t1 ORDER BY x;"; using (SQLiteDataReader dataReader = command.ExecuteReader()) { int count = 0; while (dataReader.Read()) count++; return count; } } } Alternatively, make sure they do not get garbage collected by keeping an instance of them associated with another long-lived object (i.e. WinForm) or as a static field somewhere. -- Joe Mistachkin _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com

