0

I'm new. So, hold on. This may be an inappropiate question but I don't know that. I have a friend that is working with me. He is not available for two more days. Any help would be greatly appreciated.

I am using 2008 Visual Studio.

This works:
Student/Adult:

<asp:DropDownList ID="StudentAdultDropDownList" DataSourceID="SqlDataSource3" runat="server" DataTextField="Student_Adult" DataValueField="Student_Adult" SelectedValue='<%# Bind("Student_Adult") %>' />
            <br />

This does not:
GuardianShip:

<asp:DropDownList ID="GuardianShipDropDownList" DataSourceID="SqlDataSource4" runat="server" DataTextField="GuardianShip" DataValueField="GuardianShip" SelectedValue='<%# Bind("GuardianShip") %>' />
            <br />

The error message is:
Server Error in '/' Application.
'GuardianshipDropDownList' has a SelectedValue that is invalid because it does not exist in the list of items.
Parameter name: value

The data source is a query. The names all match.

Can anybody help me?

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by __avd
0

>The data source is a query. The names all match.

How can you say that? - data source is a query.

You are assigning a value to the SelectedValue property of 'GuardianshipDropDownList' which is not available in GuardianshipDropDownList's Items collection.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.