c# - Binding same data to multiple dropdownlists using foreach loop -
We have 10 dropdowns and the data must be copied from SQL Server using the foreach loop
private wide bindedupdown (dataset DS) {foreach (control control control in Form 1.) {if ((control. GetType () == Typef (dropdown list)) {(dropdown list) (control)). Datatieffield = "information review"; (DropDownList) (Control)) DataValueField = "InformationReviewID". ((Dropdown list) (control)). Data source = databables [0]; (DropDownList) (Control)) DataBind () .; ((Dropdown list) (control)). item. Indent (0, new list item ("- select -", "0")); }}}
Comments
Post a Comment