public
{
SqlDataReader sqlData = StoredProcedure.GetDataReader(procName,p,sqlConn);
cboToPopulate.BeginUpdate();
cboToPopulate.Items.Clear();
cboToPopulate.DisplayMember = DISP_MEMBER;
cboToPopulate.ValueMember = VALUE_MEMBER;
AddItemsToIList (cboToPopulate.Items,sqlData,displayField,itemField,dataType,
cboToPopulate.EndUpdate ();
{cboToPopulate.SelectedIndex=0;}
sqlData.Close();
}Recently, I needed a function to populate a ListBox in the same way. Now I noticed that the Combo and the Listbox have the same method calls (BeginUpdate, .Items.Clear, DisplayMember, ValueMember, EndUpdate), so I thought there must be a way of just using one function and having a generic object to handle them both. However, although I think this should be possible, I don't know how to do it. What I have done, is rip out the actualt populating routine so I pass an IList object from both functions). But can someone help in writing a single function that handles both objects? Or is it not possible? Thanks in advanceRog