Reputation: 49
I have a C# program connecting to a MYSQL database. The stored procedure takes longer than 30 seconds so the connection times out. What I'm looking to do is to increase the alloted time to do the stored procedure to 5 minutes. I know that the default time out is 30 seconds and need to increase the alloted time. Is it possible to do this in C# or do I need to perform less stored procedures?
Upvotes: 2
Views: 4288
Reputation: 28970
You can also configure your timeout in your string connection by using Connect Timeout property
Config File : "Data Source=;Initial Catalog=;Connect Timeout=...."
Upvotes: 2
Reputation: 3299
Where you create your sql query command:
command.CommandTimeout = int.MaxValue;
or set int.MaxValue to the timeout of your choice.
Upvotes: 0