data binding - ASP.NET ComboBox fill and bind question -
i have long time catch asp.net, need create app has formview , several comboboxes in edit , insert templates.
i use aspxcombobox wont make difference.
i kina try understand if can have sqldatasource fill list of combobox , bind value sqldatasource. seems goal can never achieved. in windows easy normal task.
now want ask efficient way this.
any appreciated.
[edit]
i need achieve fill combobox database (datasource) , bind (datasource) similar in windows forms.
have @ sqldatsource-class. find examples on how bind sqldatasource asp.net controls dropdownlist.
<asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:mynorthwind%>" selectcommand="select employeeid, lastname, address employees" updatecommand="update employees set address=@address employeeid=@employeeid"> <updateparameters> <asp:controlparameter name="address" controlid="textbox1" propertyname="text"/> <asp:controlparameter name="employeeid" controlid="dropdownlist1" propertyname="selectedvalue"/> </updateparameters> </asp:sqldatasource> <asp:dropdownlist id="dropdownlist1" runat="server" datatextfield="lastname" datavaluefield="employeeid" datasourceid="sqldatasource1"> </asp:dropdownlist>
Comments
Post a Comment