Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a list in sharepoint with two column(name(Single line of text) and title(Single line of text))
Now I need to get a list of title that the name is "Rose"
but My code does not work and returns Total list

mycode:
XML
using (ClientContext context = new ClientContext(siteUrl))
               {
                   context.Credentials = new NetworkCredential("bbcNews", "564786", "mesbahsoft.local");
                   List oList2 = context.Web.Lists.GetByTitle(Properties.Settings.Default.ListName);


                   CamlQuery camlQuery2 = new CamlQuery();
                   camlQuery2.ViewXml = "<query><where> <eq>"+
       " <fieldref name="name" /> <value type="Text">"Rose"</value></eq></where></query>";
Posted

1 solution

Try this:

camlQuery2.ViewXml = "<query><where><eq><fieldref name='name'/><value type='Text'>Rose</value></eq></where></query>";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900