I have an application that runs on our server that functions as a 'service' for all of our in-house applications. This application has been throwing an error every 25 minutes. The error is: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." "In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user." This was not happening until we made some recent changes to our app. The code that is failing simply calls a stored procedure and executes it using an sqldatareader. The stored procedure is below:
ALTER PROCEDURE GetActivePatientCoreMeasures
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT DISTINCT ADT.[PV1 Room], adt.[Patient Account Number], [Diagnosis Codes].Description
FROM [CPSISQL].dbo.ADT
LEFT JOIN [CPSISQL].dbo.ADT_Diagnosis
ON [CPSISQL].dbo.ADT.[Patient Account Number] = [CPSISQL].dbo.ADT_Diagnosis.[Patient Account #]
RIGHT JOIN [Diagnosis Codes]
ON ADT_Diagnosis.[Diagnosis Code] = [Diagnosis Codes].Code
WHERE [CPSISQL].dbo.ADT.[PV1 Discharge Date/Time] = ''
AND
(
[CPSISQL].dbo.ADT.[PV1 Department] = '028' OR
[CPSISQL].dbo.ADT.[PV1 Department] = '030' OR
[CPSISQL].dbo.ADT.[PV1 Department] = '032' OR
[CPSISQL].dbo.ADT.[PV1 Department] = '038' OR
[CPSISQL].dbo.ADT.[PV1 Department] = '042'
)
AND NOT(ADT_Diagnosis.[Diagnosis Type] = 'A')
ORDER BY adt.[PV1 Room]
END
Here is the routine that calls the stored procedure:
Private Sub UpdateDataFromADT_Codes(SqlConn As SqlConnection)
Dim sqlCMD As SqlCommand = New SqlCommand("EXEC GetActivePatientCoreMeasures", SqlConn)
Dim readerSQL As SqlDataReader = sqlCMD.ExecuteReader()
While readerSQL.Read
Dim thePatientNumber As String = SqlToString(readerSQL(1))
Dim theCoreMeasure As String = SqlToString(readerSQL(2))
For i As Integer = 0 To QueueOfPatientData.Count - 1
If QueueOfPatientData(i).PatientNumber = thePatientNumber Then
With QueueOfPatientData(i)
Select Case theCoreMeasure
Case "PN"
.PN = "Yes"
Case "Sepsis"
.Sepsis = "Yes"
Case "STROKE"
.Stroke = "Yes"
Case "VTE"
.VTE = "Yes"
Case "CHF"
.CHF = "Yes"
Case "AMI"
.AMI = "Yes"
End Select
End With
'exit for since patient was found
Exit For
End If
Next
End While
readerSQL.Close()
End Sub
Any help will be greatly appreciated!