I have to check if list item Exists in sharepoint list using C# . if it Exists i have to update(increment) “Attempt Column” by 1 . i wrote few codes.but they are not working.i need this urgent.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not going to give you the code simply because you should attempt to solve it yourself first or at least explain that you have some knowledge of how you would go about it however i will help in give you a little insight.
You can do this a couple of ways
1
Get the
SPWeb objectwhere the item is supposed to be. Normally context of the site.Get the list where the item is supposed to live
SPWeb object.lists[listname or guidhere]Loop through the list checking if anything matches in each item or even checking if the object matches the object
The other way is to use an SPQuery object
set the
SPquery.query = "YOUR CAML STATEMENT HERE"if the above returns >0 items you have a match
Increment by one
This should give you a good starting block
cheers
Truez