string code = cmbCode.SelectedValue.ToString();code 值为System.Data.DataRowView解决办

string code cmbCode.SelectedValue.ToString(),code 值为System.Data.DataRowViewcode断点调试出来的

string code = cmbCode.SelectedValue.ToString();,code 值为System.Data.DataRowView
code断点调试出来的值是System.Data.DataRowView,是什么地方错了

[解决办法]
你没有绑定ValueMember的值吧,比如ComboBox.ValueMember=ZipCode

,如果想获得显示的值,用ComboBox.DisplayMember

msdn解释
If a property is not specified in ValueMember, SelectedValue returns the results of the ToString method of the object.