i'm developing application in .net using c# that has 1 dropdown list .I want to take data in it .to show in list.please suggest me some help
anjela
0
Newbie Poster
Recommended Answers
Jump to Postselect the info that you want into a datatable,
set the datatable as the datasource for the dropdown. call the databind function. and make sure you specify in the dropdown control which columns have correspond with the DataValueField and DataTextField
Jump to Post<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 />
All 6 Replies
campkev
0
Posting Pro in Training
anjela
0
Newbie Poster
nikkiH
2
Junior Poster in Training
sachingargava
0
Newbie Poster
sanch01r
0
Light Poster
asshankar
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.