The DataSourceID of 'visitSecDropDown' must be the ID of a control of type IDataSource. A control with ID 'rydhaveSrc' could not be found.

I am geting this error when i try and load my website, and i can't quite figure out why? I've googled a bit and not found a solution that helps me.

The DataSourceID of 'visitSecDropDown' must be the ID of a control of type IDataSource.  A control with ID 'rydhaveSrc' could not be found.


bellow is the given code

<asp:DropDownList ID="visitSecDropDown" runat="server" DataSourceID="rydhaveSrc"
                                                        DataTextField="Rydhave" DataValueField="ID" Width="155px">
                                                    </asp:DropDownList><asp:CompareValidator ID="CompareValidator1" runat="server" 

ControlToValidate="visitSecDropDown"
                                                        CultureInvariantValues="True" ErrorMessage="Please select section of visit" 

Operator="NotEqual"
                                                        ValueToCompare="Select One">*</asp:CompareValidator>

Open in new window

Vx_ChemicalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Om PrakashCommented:
Add <asp:SqlDataSource ... which is missing
<asp:SqlDataSource ID="sda_nw1" runat="server" ConnectionString='<%$ ConnectionStrings:NORTHWIND %> '         SelectCommand="SELECT orders.customerid, ContactName, count(OrderID) as numorders FROM orders join customers on orders.CustomerID=Customers.CustomerID group by orders.customerid, ContactName order by ContactName"         ProviderName="System.Data.SqlClient" OldValuesParameterFormatString="original_{0}">        </asp:SqlDataSource> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="sda_nw1" DataTextField="customerid"            DataValueField="customerid">        </asp:DropDownList><br />

Open in new window

0
Om PrakashCommented:
<asp:SqlDataSource
      ID="rydhaveSrc"
      runat="server"
      ConnectionString='<%$ ConnectionStrings:NORTHWIND %> '        
      SelectCommand="SELECT ID, Rydhave FROM table_name"        
      ProviderName="System.Data.SqlClient" OldValuesParameterFormatString="original_{0}">        
</asp:SqlDataSource>

<asp:DropDownList
      ID="visitSecDropDown"
      runat="server"
      DataSourceID="rydhaveSrc"
      DataTextField="Rydhave"            
      DataValueField="ID">        
</asp:DropDownList>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vx_ChemicalAuthor Commented:
Yes. i had some how killed my data source, now im getting something else though.

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Garden'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Garden'.

Source Error:

anyone who can solve this mystery?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.