简体   繁体   中英

MySqlCommand cmd.ExecuteReader() errors when sitting on a breakpoint for over 3 seconds

I've come across a strange bug that I can't figure out. If I set a breakpoint on a MySqlCommand cmd.ExecuteReader() and sit on the breakpoint for less than 5 seconds, then continue, everything executes without any problems. But if I sit on the breakpoint for more than 5 seconds I get the error Fatal error encountered during command execution. . The MySqlCommand.CommandTimeout is set to 30, and according to MSDN , the CommandTimeout represents seconds. The connection timeout is set to 15. Why is this happening?



Breakpoint position

在此处输入图片说明



After waiting >= 5 seconds

在此处输入图片说明

您可以尝试通过添加“ Connection Timeout=0 ”在连接字符串中指定超时。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM