Link to home
Start Free TrialLog in
Avatar of running32
running32

asked on

error in dataset

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
SOLUTION
Avatar of bchoor
bchoor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of running32
running32

ASKER

Thank you for you help.  I figured it out.