首页新闻找找看学习计划

异常信息: Column 'FinanceOverdue' is read only.求指教

0
悬赏园豆:20 [已关闭问题] 关闭于 2011-10-25 10:57

异常信息: Column 'FinanceOverdue' is read only.

          public DataTable RetFinanceDt(DataTable dt)
        {
            dt.Columns.Add("FinanceOverdue", typeof(string), "0");
            if (dt == null || dt.Rows.Count == 0)
            {
                return dt;
            }
            DataTable dtdue = GetFinanceOverdue();
            if (dtdue != null && dtdue.Rows.Count > 0)
            {
                List<string> ls = new List<string>();
                foreach (DataRow durow in dtdue.Rows)
                {
                    if (!ls.Contains(durow["FFOOrderId"].ToString()))
                    {
                        ls.Add(durow["FFOOrderId"].ToString());
                    }
                }
                foreach (DataRow dtrow in dt.Rows)
                {
                    if (ls.Contains(dtrow["orderid"].ToString()))
                    {
                        dtrow["FinanceOverdue"] = 1;
                    }
                    else
                    {
                        dtrow["FinanceOverdue"] = 0;
                    }
                }
            }
            return dt;
        }

_劍客的主页 _劍客 | 初学一级 | 园豆:94
提问于:2011-05-27 15:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册