Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

How to find a value contained in the list - sharepoint 2010

$
0
0

Dear All,

I want to put a "if" condition to check value in a List(choice data type). For this I have written following code

somebody please help me to write it correct. I am getting error

if (item.File.Name.Contains("2013"))  --- error hitting line.

I want to find out whether 2013 is available in the list or not !!!!!!



My complete working code:
---------------------------


foreach (ListItem item in lItems)
{

if (item.File.Name.Contains("2013"))
                    {
                        item["Prev_Yr_Card_Cal"] = "Yes";
                        item.Update();
                        clientContext.ExecuteQuery();
   

}


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>