SyntaxFix
Write A Post
Hire A Developer
Questions
This exception also happens if don't use transactions properly. In my case, I put transaction.Commit() right after command.ExecuteReaderAsync(), and did not wait to commit the transaction until reader.ReadAsync() were called. The proper order:
transaction.Commit()
command.ExecuteReaderAsync()
reader.ReadAsync()