void DisplayPhones() { //create an instance of the phone collection APhoneLibrary.clsPhoneCollection Phones = new APhoneLibrary.clsPhoneCollection(); //set the data source to the list of phones in the collection lstPhones.DataSource = Phones.PhoneList; //set the name of the primary key lstPhones.DataValueField = "PhoneId"; //set the data field to display lstPhones.DataTextField = "Model"; //bind the data to the list lstPhones.DataBind(); }
void DisplayPhoneModel() { //create an instance of the County Collection APhoneLibrary.clsPhoneCollection PhoneModel = new APhoneLibrary.clsPhoneCollection(); //set the data source to the list of Phone in the collection ddlPhoneMake.DataSource = PhoneModel.PhoneList; //set the name of the primary key ddlPhoneMake.DataValueField = "PhoneID"; //set the data field to display ddlPhoneMake.DataTextField = "PhoneModel"; //bind the data to the list ddlPhoneMake.DataBind(); }