I have a query that is taking longer to execute as the database increases in size. The query is optimized and necessary, but my C# Console Application has recently been giving me this error:
Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Timeout expired.
Increasing the connection time out in the connection string doesn't help; I increased it from
Connect Timeout=28800
to
Connect Timeout=128800
but I'm still getting the error despite this change.
If I run the query from MySQL workbench it only take about 10 seconds, so I'm not sure how to prevent this Unhandled Exception.
Are there other things, besides "the time a query takes", that can produce this exception?
CommandTimeout
not theConnectionTimeout
. – Unplaced