我有这样的组合框无法转换诠释为int FO组合
BindingSource srd = new BindingSource();
srd.DataSource = llenar.Tables["cnae"];
CmbCnaePrin.DataSource = srd;
CmbCnaePrin.DisplayMember = "cnae_descricao";
CmbCnaePrin.ValueMember = "cnae_id";
我希望加载这个
int cnaepr;
DataTable dt3 = new DataTable();
dt3 = ifd.cnaeclas(cnaepr);
txtCnaeC.Text = dt3.Rows[0][2].ToString();
txtCnaeSC.Text = dt3.Rows[0][3].ToString();
,但我不能转换
cnaepr=Convert.ToInt32(CmbCnaePrin.SelectedValue)
返回此错误无法投射“System.Data.DataRowView”类型的对象来键入“System.IConvertible”。
什么是双重否定?这是否意味着你实际上可以转换为int?附: [请不要在标题中包含C#](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles) – Kiril