SharePoint中的业务数据连接拒绝

时间:2012-04-18 20:45:55

标签: sharepoint web-parts bcs

我实际上使用BCS连接到外部内容,我可以看到SharePoint中的列表,但是当我尝试通过VS Web部件使用该列表时,我得到了这种锥度误差,但是当我从负载调用列表时会发生这种情况事件'因为当我从button_click事件调用它时效果很好,请一些帮助将不胜感激,这里是代码:

protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack) loadPeoplesBDay();
        }

public void loadPeoplesBDay()
        {
            if (WebPart.List == null) return;

            SPWeb Web = SPContext.Current.Web;
            SPList List = Web.Lists[WebPart.List];

            var q = List.Items;
            var onomasticos = from persona in q.Cast<SPItem>()
                              where Convert.ToDateTime(persona["FE_NACI_TRAB"]).Month == DateTime.Now.Month
                              orderby Convert.ToDateTime(persona["FE_NACI_TRAB"]).Day ascending
                              select new { Nombre = persona["NO_TRAB"] + " " + persona["NO_APEL_PATE"] + " " + persona["NO_APEL_MATE"], Area = persona["DE_SECC"], DiaNacimiento = Convert.ToDateTime((Convert.ToDateTime(persona["FE_NACI_TRAB"]).Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year)), Mes = persona["FE_NACI_TRAB"] };

            dlst_Onomasticos.DataSource = onomasticos;
            dlst_Onomasticos.DataBind();
        }

0 个答案:

没有答案