I have a method like the following in a Utility class. I would like to change the parameter dataSource to accept any type of datasource i.e. dataset, dataview, List, datatable, arraylist.
Is this possible? How would I change the method signature (and parameters and types) to allow me the flexibility of passing in any acceptable datasource for binding?
Thank you
public void FillCombo(DropDownList ddl, DataTable dataSource, string textField, string valueField, bool addSelect) {
ddl.DataValueField = valueField;
ddl.DataTextField = textField;
ddl.DataSource = dataSource;
ddl.DataBind();
if (addSelect) AddSelectCombo(ddl, "Select", -1);
}