System.Data.DataRowView(显示在多列组合框中)

时间:2013-11-06 01:18:07

标签: c# windows combobox

我尝试在组合框中执行多列,我想证明第二列是正确的,

但在完成以下代码后,组合框中显示的项目被替换为: System.Data.DataRowView

string sql = "SELECT customer.customer, arcustmst.cust_name_1 FROM customer INNER JOIN arcustmst ON customer.customer=arcustmst.cust_code";

        SqlCommand custcom = new SqlCommand(sql, myconnection);

        SqlDataAdapter da = new SqlDataAdapter(custcom);
        DataSet1 ds = new DataSet1();
        da.Fill(ds, "customerFrom");

        cboFrom.DisplayMember = "customer.customer" + string.Format({0,-5}, "arcustmst.cust_name_1");
        cboFrom.ValueMember = "customer.customer" + string.Format({0,-5}, "arcustmst.cust_name_1");
        cboFrom.DataSource = ds.Tables["customerFrom"];

结果:

enter image description here 任何人都可以帮助和指导。

提前致谢

0 个答案:

没有答案