I have added items in a combo box using datatable and rows. First it returned the value, and now it's returning dataRow. I don't know the reason why it's returning like that. Can anyone help?
string selectedValue = cbx_language.Text.ToString();
I have added items in a combo box using datatable and rows. First it returned the value, and now it's returning dataRow. I don't know the reason why it's returning like that. Can anyone help?
string selectedValue = cbx_language.Text.ToString();
Use string selectedValue = cbx_language.SelectedItem.ToString
This way, it does not matter what type of items you add using Items.Add/Insert.
Is the value you are getting is System.data.datarow? & if It is then Please set valueMember & DisplayMember properties of combo box to the column name u fetching in datatable.