1
我試圖在C#中設置viewfields property = true,以獲取我從「Getlistitems」SOAP調用返回的「ows_MetaInfo」屬性中所需的某些值。如果我使用代碼創建XML,我該如何去做這件事?如何在C#中將「viewfields」屬性設置爲true#
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlElement query = xmlDoc.CreateElement("Query");
System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");
System.Xml.XmlElement rowLimit = xmlDoc.CreateElement("RowLimit");
System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions");
System.Xml.XmlElement webID = xmlDoc.CreateElement("WebID");
後先看了看http://msdn.microsoft.com/en-us/library/cc264031.aspx我試過,沒有運氣設置viewFields屬性:
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlElement query = xmlDoc.CreateElement("Query");
System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");
viewFields.SetAttribute("Properties", "True");
System.Xml.XmlElement rowLimit = xmlDoc.CreateElement("RowLimit");
System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions");
System.Xml.XmlElement webID = xmlDoc.CreateElement("WebID");