我尝试在组合框中执行多列,我想证明第二列是正确的,
但在完成以下代码后,组合框中显示的项目被替换为: 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"];
结果:
任何人都可以帮助和指导。
提前致谢