Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The page needs a link provided on this page that reads ‘First Time Logging In?’. This will feed to a page that asks the user for the 5 digit company code, and compare this code with the list in sharepoint. If code match go to next page otherwise error.

I created a page , which will take 5 digit company code. But i don't know how to compare with the list.

Any help will be great!
Posted

1 solution

This is basic SharePoint knowledge

SPQuery query = new SPQuery();
query.Query = "<Where>
   <Eq>
     <FieldRef Name='myFieldName' />
      <Value Type='Text'>value to test for</Value>
  </Eq>
</Where>
";
SPList list = web.Lists["myList"];
SPListItemCollection items = list.GetItems(query);
 
Share this answer
 
Comments
anjumnavid 12-May-11 9:30am    
Thanks , Mark . Would you please let me know . Is this code will be in VS ? should i create a VS project and add this code there and deploy it .

Thanks,
[no name] 12-May-11 10:25am    
i want to be helpful but if you don't know how to use this then you have a lot more to learn about SharePoint before I can even begin to help

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