I have the following challenge ahead and have no Idea where to start with regards to the SharePoint part.

  • SharePoint document library with meta data, Country, state and suburb for each document
  • Stand alone C# .net application - customer data, a customer will have the following values Country, state and suburb.
  • in Application-A I want to add a push button - 'Relevant Documentation', when the user clicks on the push button we can retrieve the country, state and suburb from Application-A database (don't need help with this).

This is where I need some detailed guidance.

  • Now we need to send the parameters to SharePoint and display only the documents where the metadata corresponds to the input parameters.

You can use the C# CSOM in order to retrieve the items in the list. And using a CAML query to only get the data you need.

ClientContext ctx = new ClientContext("http://sharepointurl");
ctx.Credentials = new NetworkCredential("username", "password", "domain");

List list = ctx.Web.Lists.GetByTitle("listname");
CamlQuery query = new CamlQuery();
query.ViewXml = String.Format("<Query><Where><Eq><FieldRef Name='Country'/><Value type='Text'>{0}</Value></Eq></Where></Query>", lookupCountry);

var items = list.GetItems(query);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.