0

我有个问题!:( 我在 C# 中为 Visual Studio 2012 编程,我正在构建一个使用来自 Sharepoint 2013 的数据的内部网。我在寄存器中有问题。

在 SharePoint 2013 中,我有一个列表。在该列表中,其中一列属于“选择”类型。当我从 C# 调用保存信息时,显然已保存。但是,在看到 Sharepoint 2013 中的结果后,我看到的不是,所以信息没有保存。

在 SharePoint 2013 中,仅保存默认复选框元素(第一个元素),但不保存正确的选择。

我的代码:


SharePointConnector.SharePointEntities.TestDeInteresItem test = new SharePointConnector.SharePointEntities.TestDeInteresItem();

List<SharePointConnector.SharePointEntities.TestDeInteresInteresesPersonalesValue> personalList = new List<SharePointConnector.SharePointEntities.TestDeInteresInteresesPersonalesValue>();//0

test.AlumnoId = student.Identificador;
string[] auxPersonal = possibleInterest.Personal.Split(',');
for (int i = 0; i < auxPersonal.Length; i++)
{
        string s = auxPersonal[i];
        if (s.Length > 0)
        {
               var allInterest = englishDataContext.TestDeInteresInteresesPersonales.ToList();
               var element = allInterest.Where(x => x.Value.Equals(s)).FirstOrDefault();
               if (element != null)
               {
                            SharePointConnector.SharePointEntities.TestDeInteresInteresesPersonalesValue personal = new SharePointConnector.SharePointEntities.TestDeInteresInteresesPersonalesValue();
                            personal.Value = element.Value;
                            test.InteresesPersonales.Add(personal); //1
               }
        }
}

englishDataContext.AddToTestDeInteres(test); //2
englishDataContext.SaveChanges(); //3

--- //0 -> Initially, the list of elements (column when to type is election) is empty.

//1 -> The element is added successfully

//2 -> In this step, the information to added is correctly...

//3 -> ...but save allinformation correctly less the item cited (column when to type is election). This element is save default election (First element to checkbox)

有任何想法吗?

4

1 回答 1

0

我已经解决了这个问题。上下文是错误的。

http://msdn.microsoft.com/en-us/library/office/fp179912%28v=office.15%29.aspx

于 2014-03-31T16:10:43.207 回答