I have 5 ComboBoxes and want to populate each of them by the same DataSet
foreach (Control c in panPrev.Controls)
{
if ((string)c.Tag == "cb") //these are ComboBoxes
{
c.DataSource = ds01.Tables[0];
c.DisplayMember = "cars";
}
}
Error 1: 'System.Windows.Forms.Control' does not contain a definition for 'DataSource'...
Error 2: 'System.Windows.Forms.Control' does not contain a definition for 'DisplayMember..
Please, help.