简体   繁体   English

在C#上减少MySQL上的超时异常

[英]reducing timeout exception on MySQL on C#

im trying to control MySQL tables using C#, though it takes my program 5 seconds to load on a 3MBPS internet, and sometimes it throws a timeout exception because my program is taking too long to connect... 我试图使用C#控制MySQL表,虽然它需要我的程序5秒加载3MBPS互联网,有时它会抛出超时异常,因为我的程序需要太长时间连接...

follow up question, does the time for the connection to open the only thing that is hard up on loading, or does the queries have an effect? 跟进问题,是否有时间连接打开加载时难以解决的问题,或者查询是否有效?

You have two time out values. 你有两个超时值。 Your connection has it's own timeout. 您的连接有自己的超时时间。 This is the period you allow your provider to try and connect to the database. 这是您允许提供程序尝试连接到数据库的时间段。

Secondly you have a Command Timeout, and this is the amount of time you allow your query to execute before a timeout exception is raised. 其次,您有一个命令超时,这是您在引发超时异常之前允许查询执行的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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