私は問題があります!:( Visual Studio 2012 用に C# でプログラミングしており、Sharepoint 2013 のデータを使用するイントラネットを構築しています。登録に問題があります。
SharePoint 2013 にはリストがあります。そのリストでは、列の 1 つが「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)
何か案は?