string siteUrl = Properties.Settings.Default.SharePointSiteUrl;
string libraryGUID = Properties.Settings.Default.LibraryGUID;
SPListService.Lists spLists = new SPListService.Lists();
spLists.Url = siteUrl + @"/_vti_bin/lists.asmx";
spLists.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Instantiate an XmlDocument object
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
string listName = libraryGUID;
string viewName = "";
string rowLimit = "500";
/*Use the CreateElement method of the document object to create elements for the parameters that use XML.*/
System.Xml.XmlNode query = xmlDoc.CreateElement("Query");
System.Xml.XmlNode viewFields =
xmlDoc.CreateElement("ViewFields");
System.Xml.XmlNode queryOptions =
xmlDoc.CreateElement("QueryOptions");
query.InnerXml = "<Where><And><Eq><FieldRef Name=\"CONTRACT_NO\"/><Value Type=\"Text\">" + contractNo + "</Value></Eq>" +
"<Eq><FieldRef Name=\"ACTIVITYTYPE\"/><Value Type=\"int\">" + activityType + "</Value></Eq></And></Where>";
viewFields.InnerXml = "<FieldRef Name=\"CONTRACT_NO\" />" +
"<FieldRef Name=\"ACTIVITY\" />" +
"<FieldRef Name=\"ACTIVITYDATE\" />" +
"<FieldRef Name=\"DOCCATEGORY\" />" +
"<FieldRef Name=\"DOCSTATUS\" />" +
"<FieldRef Name=\"DOC_TYPE\" />" +
"<FieldRef Name=\"RECEIVED\" />" +
"<FieldRef Name=\"FIRSTVIEWDATE\" />" +
"<FieldRef Name=\"REFNO\" />";
queryOptions.InnerXml = "";
System.Xml.XmlNode nodeListItems = spLists.GetListItems
(listName, viewName, query, viewFields, rowLimit, queryOptions, null);
foreach (System.Xml.XmlNode listItem in nodeListItems)
{
string innerXml = listItem.InnerXml;
docCount++;
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE