using (SqlCommand sqlCmd = new SqlCommand(sqlQueryString, sqlConnection)) { sqlCmd.CommandTimeout = 0; // 0 = give it as much time as it needs to complete ... }