I am working on a conversion project moving a VB6 application to .NET. Some of this conversion was begun previously by another consultant no longer here.

Everything went fine in test. When we moved to a production environment and started querying a large database, we got a query timeout.

I did some digging and I found in VB6 when the ADODB.Connection object was instantiated, its CommandTimeout property was set to 0. So every single query the application runs can take however long it wants. This timeout was not converted to .NET so every query is limited to the default of 30 seconds.

In .NET we are using an OleDbConnection which doesn't have a CommandTimeout property. I don't want to put a CommandTimeout on every single command object before I run a query - that would be a long coding change (but of course doable if that's the best solution). This website says you can put a command timeout in your connectionstring, so I am wondering if that one change would be the best place.

Thanks.

(And you will probably say further analysis should be done to determine only the queries that need an exceedingly long time to run, but because we are converting a "working" VB6 application I don't think I can justify the time to do that analysis. If it works it VB6 with an infinite timeout, it will work in .NET with an infinite timeout.).