0

我试图在组合框中做多列,我想证明第二列是合理的,

但在我完成以下代码后,组合框中显示的项目替换为: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"];

结果:

在此处输入图像描述 任何人都可以请帮助和指导。

提前致谢

4

0 回答 0