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

后端 未结 5 676
暖寄归人
暖寄归人 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:44

    I know that this question is old, but I just wanted to let you guys know that If you get this error make sure you are using

        ComboBoxName.DisplayMemberPath = "name of the column that you want to show in the combobox (ex: name)"  
        ComboBoxName.SelectedValuePath = "name of the column (ex:id)";  
    

提交回复
热议问题