首页 新闻 会员 周边 捐助

SortedList Add方法添加键值 发现竟然有的不能添加,什么问题?

0
悬赏园豆:5 [已关闭问题]

环境 :一个button事件中 的一个else 分支中

用SortedList Add 方法添加键值,我写了9个,当然全是不相同的,发现竟然有些没有添加,

是什么原因,难道是微软的bug??

 

问题补充: using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using KnL; public partial class Tools_corps_officeFee : HUserBase { CHCorpsOfficeFee ofee; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HConfig.BindMonths(dpd_months); NumericUpDown1.InitValue = DateTime.Now.Year; dpd_months.SelectedValue = DateTime.Now.Month.ToString(); string thismonth = DateTime.Now.ToString("yyyy年M月"); ofee = new CHCorpsOfficeFee(thismonth); if (ofee.Exists) { txt_cxjcfee.Text = ofee.items["ChaoXjceFee"].ToString(); txt_keyanfee.Text = ofee.items["KeyanFee"].ToString(); txt_officefee.Text = ofee.items["OfficeFee"].ToString(); txt_qitafee.Text = ofee.items["QitaFee"].ToString(); txt_summary.Text = ofee.items["Summary"].ToString(); txt_totalfee.Text = ofee.items["Total"].ToString(); txt_trainfee.Text = ofee.items["TrainingFee"].ToString(); txt_ywuxcfee.Text = ofee.items["TrainingFee"].ToString(); } } } //填入 protected void Button1_Click(object sender, EventArgs e) { string thismonth = DateTime.Now.ToString("yyyy年M月"); string nextmonth = DateTime.Now.AddMonths(1).ToString("yyyy年M月"); ofee = new CHCorpsOfficeFee(thismonth); if (ofee.Exists) { } else { ofee = new CHCorpsOfficeFee(); SortedList items
Longkin的主页 Longkin | 初学一级 | 园豆:3
提问于:2009-01-08 09:08
< >
分享
其他回答(1)
0

如果方便,提供一下你的“示意性”代码(不用完整的源码),个人猜测是你的算法问题;但凡企业级的应用框架都是经过严格测试的,出现这样明显bug的概率很少;也或者是对 SortedList 的理解有误。

陛下 | 园豆:3938 (老鸟四级) | 2009-01-08 09:13
0

txt_trainfee.Text = ofee.items["TrainingFee"].ToString();
txt_ywuxcfee.Text = ofee.items["TrainingFee"].ToString();
为什么他们俩的键值相同?

1-2-3 | 园豆:200 (初学一级) | 2009-01-09 11:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册