Resolving SQL Command Timeout Issues in ASP.NET
If your application displays the error "Connection to database has timed out.", it often means the database operation is taking longer than the default timeout period. This commonly occurs when a SqlDataReader is performing heavy processing or returning a large result set.