Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.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# 0x81020014一个或多个字段类型未正确安装。转到列表设置页面删除这些字段_C#_Sharepoint_Sharepoint 2007_Caml - Fatal编程技术网

C# 0x81020014一个或多个字段类型未正确安装。转到列表设置页面删除这些字段

C# 0x81020014一个或多个字段类型未正确安装。转到列表设置页面删除这些字段,c#,sharepoint,sharepoint-2007,caml,C#,Sharepoint,Sharepoint 2007,Caml,在sharepoint中,当尝试更新列表时,出现以下错误: 0x81020014One or more field types are not installed properly. Go to the list settings page to delete these fields. 正在创建的Caml是: <Batch PreCalc='TRUE' OnError='Continue'> <Method ID='1' Cmd='Update'>

在sharepoint中,当尝试更新列表时,出现以下错误:

0x81020014One or more field types are not installed properly. Go to the list settings page to delete these fields.
正在创建的Caml是:

<Batch PreCalc='TRUE' OnError='Continue'>
    <Method ID='1' Cmd='Update'>
        <Field Name='ID'>4</Field>
        <Field Name='Flagged'>False</Field>
     </Method>
</Batch>

4.
假的
当我从U2U运行Caml时,它工作正常,字段更新。当我在VS中调试代码时,我得到了上面的错误

创建和调用批处理的代码如下:

var ws = new com.freud.intranet.lists.Lists {
  Url = WebServiceHelper.wsContactsList,
  Credentials = WebServiceHelper.AdminCredentials
};
var batch = "<Batch PreCalc='TRUE' OnError='Continue'><Method ID='1' cmd='Update'><Field Name='ID'>" + contactID
            + "</Field><Field Name='Flagged'>" + flag + "</Field></Method></Batch>";
var document = new XmlDocument();
var stringReader = new StringReader(batch);
var xmlReader = XmlReader.Create(stringReader);
var node = document.ReadNode(xmlReader);
ws.UpdateListItems("Master Contact Joining Table", node);
var ws=new com.freud.intranet.lists.lists{
Url=WebServiceHelper.wsContactsList,
凭据=WebServiceHelper.AdminCredentials
};
var batch=“”+联系人ID
+“+标志+”;
var document=新的XmlDocument();
var stringReader=新的stringReader(批处理);
var xmlReader=xmlReader.Create(stringReader);
var节点=document.ReadNode(xmlReader);
UpdateListItems(“主联系人连接表”,节点);
为什么caml在U2U中工作而不是在VS中工作


通过谷歌搜索,问题可能是因为我没有使用内部名称,但它确实在U2U中运行,这就是我感到困惑的原因。

我在代码中使用了错误的列表,因此出现了错误。

使用列表的诀窍是获得正确的Web服务位置,将引用的Web服务中的URL设置为正确的位置,并使用列表中定义的字段名称

    private void ReadTaskandAddtask()
    {
        try
        {
            tcfifsharepoint.Lists listServiceBase = new tcfifsharepoint.Lists();

            // SharePoint Web Serices require authentication
            listServiceBase.Credentials = System.Net.CredentialCache.DefaultCredentials;
            listServiceBase.Url = "http://SPServer/Site/_vti_Bin/lists.asmx";

            String newIssueTitle = "Programmatically added issue 3";

            String listGUID = "FC519894-509A-4B66-861E-2813DDE14F46";
            String activeItemViewGUID = "C93FFC02-368B-4D06-A8AE-3A3BA52F4F0C";
             listGUID = "{FC519894-509A-4B66-861E-2813DDE14F46}";
             activeItemViewGUID = "{DCF35B63-F85C-463B-B1A1-716B4CF705C5}";

            // first check if item is already in the list
            XmlNode activeItemData = listServiceBase.GetListItems(listGUID, activeItemViewGUID, null, null, "", null, "");
            if (!activeItemData.InnerXml.Contains(newIssueTitle))
            {
                //*********************This is Working *********************************
                StringBuilder sb_method = new StringBuilder();
                sb_method.Append("<Method ID=\"1\" Cmd=\"New\">");
                sb_method.Append("<Field Name=\"Title\">Some Title 14</Field>");
                sb_method.Append("<Field Name=\"AssignedTo\">Name to assign</Field>");
                sb_method.Append("<Field Name=\"Status\">In Progress</Field>");
                sb_method.Append("<Field Name=\"Priority\">(3) Low</Field>");
                sb_method.Append("<Field Name=\"DueDate\">");
                sb_method.Append(DateTime.Parse(DateTime.Now.ToString()).ToString("yyyy-MM-ddTHH:mm:ssZ"));

                sb_method.Append("</Field>");
                sb_method.Append("<Field Name=\"PercentComplete\">.34</Field>");
                sb_method.Append("<Field Name=\"Body\">Something entered into the description field.</Field>");
                sb_method.Append("<Field Name=\"Author\">Your Author</Field>");
                sb_method.Append("<Field Name=\"Editor\">This is Modified By</Field>");
                sb_method.Append("</Method>");

                XmlDocument x_doc = new XmlDocument();

                XmlElement xe_batch = x_doc.CreateElement("Batch");
                xe_batch.SetAttribute("OnError", "Return");
                xe_batch.InnerXml = sb_method.ToString();

                XmlNode xn_return = listServiceBase.UpdateListItems("Task List Name", xe_batch);
        }
        catch (Exception e)
        {
            string sMessage = e.Message;

        }
    }
private void readtask和addtask()
{
尝试
{
tcfifsharpoint.Lists listServiceBase=新的tcfifsharpoint.Lists();
//SharePoint Web服务需要身份验证
listServiceBase.Credentials=System.Net.CredentialCache.DefaultCredentials;
listServiceBase.Url=”http://SPServer/Site/_vti_Bin/lists.asmx";
String newIssueTitle=“以编程方式添加的问题3”;
字符串listGUID=“FC519894-509A-4B66-861E-2813DDE14F46”;
字符串activeItemViewGUID=“C93FFC02-368B-4D06-A8AE-3A3BA52F4F0C”;
listGUID=“{FC519894-509A-4B66-861E-2813DDE14F46}”;
activeItemViewGUID=“{DCF35B63-F85C-463B-B1A1-716B4CF705C5}”;
//首先检查项目是否已在列表中
XmlNode activeItemData=listServiceBase.GetListItems(listGUID,activeItemViewGUID,null,null,”;
如果(!activeItemData.InnerXml.Contains(newIssueTitle))
{
//*********************这是有效的*********************************
StringBuilder sb_方法=新建StringBuilder();
sb_方法。追加(“”);
sb_方法附加(“某些标题14”);
sb_方法追加(“指定名称”);
sb_方法追加(“进行中”);
sb_方法附加(“3)低”);
sb_方法。追加(“”);
sb_method.Append(DateTime.Parse(DateTime.Now.ToString()).ToString(“yyy-MM-ddTHH:MM:ssZ”);
sb_方法。追加(“”);
sb_方法附加(“.34”);
sb_method.Append(“在描述字段中输入的内容”);
sb_method.Append(“您的作者”);
sb_方法追加(“此项由修改”);
sb_方法。追加(“”);
XmlDocument x_doc=新的XmlDocument();
XmlElement xe_batch=x_doc.CreateElement(“批次”);
xe_batch.SetAttribute(“OnError”、“Return”);
xe_batch.InnerXml=sb_method.ToString();
XmlNode xn_return=listServiceBase.UpdateListItems(“任务列表名称”,xe_批次);
}
捕获(例外e)
{
字符串sMessage=e.Message;
}
}
通过选择“设置”下拉列表并选择“列表设置”项,可以查看SharePoint列表中列表项(列)使用的内部名称。
进入列表设置后,单击一列,然后查看URL以查看“Field=Name”。这是创建字段时需要使用的名称。

此外,您还可以尝试打开SharePoint Designer并查看任何给定的列表表单或视图

如果您四处搜索一段时间,您将找到列表GUID、视图GUID,然后是所有列表列。在使用GetListItems检索列表项时,查找SPD特别有用,您需要使用“ows_”+ColumnName解析XML