When i get SelectedItem in combobox return System.Data.DataRowView

后端 未结 5 664
暖寄归人
暖寄归人 2020-12-21 14:26

this is a function for retrive two field in sql to combobox : Code :

public void FillCmbKala()
    {
        cmbKala.Items.Clear();
                 


        
5条回答
  •  情话喂你
    2020-12-21 14:55

    The thing you are selecting IS a DataRowView. You should select the id of the item or the text instead right? Like string str= cmbKala.SelectedItem.Text or string str= cmbKala.SelectedItem.Value?

提交回复
热议问题