I appreciate if one of the developers can give me a hint where I can find a workaround or a fix for this issue.
In summary –
I have a plugin that acts on the sales quote window on save.
The event is - SalesQuote.SaveEnd
There is a lot of code - however the theory is simple. In this code I read the database in several different functions using a sql connection, command and a data reader.
Each function closes and disposes the data reader , command and the connection in its own finally block.
However :
After the second call to a certain function (getSalesQuoteLinesInventoryID) (that reads the database) – the next function call (to read the database) gives me the following error.
“there is already an open datareader associated with this command which must be closed”
As indicated above I close all objects. In addition I have spent a the whole day today trying to isolate any syntax errors that I cannot find.
Attached is the code if you could have a look. Attached also is the screenshot sequence of function calls and the last of which gives the error.


