Link to home
Start Free TrialLog in
Avatar of 66chawger
66chawgerFlag for United States of America

asked on

VB.NET Cannot Bind This Event : Column does not belong to table

I am receiving a VB.NET run time error as stated in the title.  I changed a text field to a drop-down as follows in bold, specifically the line next to the arrows.

                    Dim LI As ListItem
                    If DR("Employee_Cd").ToString.Length > 0 Then

-->>>>>>          LI = New ListItem(DR("Employee_Nm"), DR("Employee_Cd"))
                        If Not Me.ddlEmployeeName.Items.Contains(LI) Then
                            Me.ddlEmployeeName.Items.Add(LI)
                        End If
                    End If
                    ddlEmployeeName.SelectedValue = DR("Employee_Cd")


                  "This code follows the above and is working correctly"

                    If DR("Supervisor_Cd").ToString.Length > 0 Then

                        LI = New ListItem(DR("Supervisor_Nm"), DR("Supervisor_Cd"))
                        If Not Me.ddlSupervisor.Items.Contains(LI) Then
                            Me.ddlSupervisor.Items.Add(LI)
                        End If
                    End If
                    ddlSupervisor.SelectedValue = DR("Supervisor_Cd")
ASKER CERTIFIED SOLUTION
Avatar of Ronald Buster
Ronald Buster
Flag of Netherlands 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
Avatar of 66chawger

ASKER

That's what I don't understand...if you look at the code right below it, i.e, supervisor_nm, is not explicitly defined in the queryresult either.
Ron,

I am just overthinking.... you are correct!   The data event that is saved is returned in a separate query result via a different stored procedure.   I just needed to take the blinders off.  Thanks!
Expert stated the obvious... which in this case is what I needed to be looking at.   Never afraid to ask a question and always glad when someone replies in kind.