ExecuteScalar requires the command to have a transaction when the connection assigned to the command is in a pending

ExecuteScalar requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.

原文地址:https://www.cnblogs.com/captain_ccc/p/1472334.html