Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Sharepoint 2013中使用c选中多个复选框_C#_Sharepoint_Checkbox_Sharepoint 2013_Multichoiceitems - Fatal编程技术网

C# 在Sharepoint 2013中使用c选中多个复选框

C# 在Sharepoint 2013中使用c选中多个复选框,c#,sharepoint,checkbox,sharepoint-2013,multichoiceitems,C#,Sharepoint,Checkbox,Sharepoint 2013,Multichoiceitems,我有个问题!:我使用C语言为Visual Studio 2012编程,正在构建一个使用Sharepoint 2013数据的内部网。我的登记册有问题 在SharePoint 2013中,我有一个列表。在该列表中,其中一列的类型为choice。当我从C调用保存信息时,显然是保存了。但是,在Sharepoint 2013中看到结果后,我看到的结果并非如此,因此信息不会保存 在SharePoint 2013中,仅在第一个元素中保存默认复选框元素,但不保存正确的选择 我的代码: 有什么想法吗?我已经解决了

我有个问题!:我使用C语言为Visual Studio 2012编程,正在构建一个使用Sharepoint 2013数据的内部网。我的登记册有问题

在SharePoint 2013中,我有一个列表。在该列表中,其中一列的类型为choice。当我从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)