How can I get the data from stored proc n show on the dropdownbox in c# .net client side? I have to tried the follwoing code but this is not working for me .. 🙁 can anyone tell me what is going wrong here?
<div id="test-area">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:DropDownList ID="DropDownEventType" runat="server" CssClass="dropDownEventType" DataSourceID="spdropDownEventType">
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
<asp:AccessDataSource
ConnectionString="<%= ConnectionStrings:ApplicationServices %>"
SelectCommand="app_Event_Type_Select"
SelectCommandType="StoredProcedure"
ID="spdropDownEventType"
runat="server"></asp:AccessDataSource>
</td>
</tr>
</table>
</div>
Try to add DataTextField and DataValueField to the DropDownList.
Delete the attribute
ConnectionString, and set theDataFilepreporty codebehind. You can not use<%= %>in a server-side control attribute, it will cause parse erroraspx
cs: