我想在 .net 3.5 中使用一些分隔符将我的下拉列表与两个值绑定 [如 '-' 或 '/']。
qry = "SELECT CityName, MasterState.StateName FROM MasterCity INNER JOIN "+
"MasterState ON MasterCity.StateID = MasterState.StateID order by CityName";
DropCity.DataMember = "DeafultView";
//DropCity.DataTextField = "CityName";
//DropCity.DataValueField = "CityName";
DropCity.DataTextFormatString = "{0} - {1}";
DropCity.DataTextField = "CityName,StateName";
DropCity.DataSource = dt;
DropCity.DataBind();
DropCity.Items.Insert(0, "-Select-");**
我做到了,但它给出了错误
DataBinding:“System.Data.DataRowView”不包含名为“CityName,StateName”的属性。”}
我怎样才能做到这一点?