What is the difference between each of these? Can I use any of these methods to display the text of a combo box in label, or is there any difference?
label1.Text = comboBox1.SelectedItem.ToString();
label2.Text = comboBox1.Text;
label3.Text = comboBox1.SelectedValue.ToString();
I am testing these values of the Combo box, but I'm confused as to how they work. I want to display the text of a combo box in label. Using comboBox.Text it works fine but the remaining two give the following error:
error message:Object reference not set to an instance of an object.