From: Pierre A. <Pie...@ms...> - 2003-08-26 14:17:00
|
Hello Carlos, This one is for you, I guess... I did a very simple test with your .NET Provider 1.5, and I get a systematic crash in property 'get' of FbCommand.RecordsAffected, with statement == null. Here is my code snippet : -----------------------8<-------------->8------------------------ FbCommand command = connection.CreateCommand (); command.CommandType = System.Data.CommandType.Text; command.CommandText = "SELECT * FROM RDB$DATABASE;"; System.Data.IDataAdapter adapter = new FbDataAdapter (command); System.Data.DataSet dataset = new System.Data.DataSet (); adapter.Fill (dataset); -----------------------8<-------------->8------------------------ When executing the Fill, a GdsStatement object gets created in FbCommand.InternalPrepare, and then an internal FbDataReader calls command.NextResult, which results in FbCommand.NextResult dropping the statement and setting it to null. However, somewhat later, that same internal FbDataReader gets disposed -> Close -> updateRecordsAffected -> RecordsAffected, which results in an access to statement, which is null, and a subsequent crash. I have fixed FbCommand.RecordsAffected like so: internal int RecordsAffected { get { return statement == null ? -1 : statement.RecordsAffected; } } but I don't know if this is the right kind of fix. Any comments/suggestions/thoughts ? Pierre |