My sub routine keeps giving me an out of memory error when it tries to execute programmatch = DataSet901.Tables("tblrecordsmanagement").Rows(i).Item("program") There is one row retruned in the recordset. Can someone tell me what programming mistake I have made. Thank you
DataSet901.Clear()
SqlDataAdapter2.SelectCommand.Parameters("@param9").Value = lngpatientid
Dim rowCount As Integer = SqlDataAdapter2.Fill(DataSet901)
Dim i
i = 0
MsgBox(rowCount)
Do While rowCount <> i
Dim programmatch
programmatch = DataSet901.Tables("tblrecordsmanagement").Rows(i).Item("program")
i = i + 1
If programmatch = "PA" Then
Label25.BackColor = Color.Red
CheckBox5.Checked = True
End If
If programmatch = "Medical Services" Then
Label27.BackColor = Color.Red
CheckBox4.Checked = True
End If
If programmatch = "Dental" Then
Label26.BackColor = Color.Red
CheckBox3.Checked = True
End If
If programmatch = "HP" Then
Label25.BackColor = Color.Red
CheckBox5.Checked = True
End If
If programmatch = "Connections" Then
Label28.BackColor = Color.Red
CheckBox2.Checked = True
End If
Loop
ASKER