出於某種原因,第1部分工作,但第2部分沒有。當以相反的順序運行(1之前的2)時,第1部分(隸屬關係)根本不運行。所有的數據都是一樣的。C# - 爲什麼這段代碼無法正常工作的任何原因?
//Section 1
UserService.DsUserAttributes dsAffiliation = us_service.GetUserAttributeDropDown(systemId, "Affiliation");
Affiliation.DataSource = dsAffiliation.tblDropDownValues;
Affiliation.DataTextField = "AttrValue";
Affiliation.DataValueField = "Id";
Affiliation.DataBind();
//Section 2
UserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, "Country");
Country.DataSource = dsCountry.tblDropDownValues;
Country.DataTextField = "AttrValue";
Country.DataValueField = "Id";
Country.DataBind();
更多信息可以診斷。拋出異常嗎?你有沒有用調試器? – 2008-10-08 15:18:33