In almost every database we have a process that filters the same data with different filters. Typically, query is within a stored procedure that has many filtering parameters that are optional. The problem is – a query optimized builds only ONE plan that will handle every filter combination you throw at it.

ADO.Net Data Provider for SQL Server (System.Data.SqlClient namespace in System.Data.dll assembly) has two common classes we often use: SqlConnection and SqlCommand. SqlCommand class has CommandTimeout property (do not mix it with the ConnectionTimeout which stops long login process). But, do …

CommandTimeout – How to handle it properly? Read more »