Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7431335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:16:46+00:00 2026-05-29T09:16:46+00:00

I have a few generic questions about what are the best practices for SharePoint(2010).

  • 0

I have a few generic questions about what are the best practices for SharePoint(2010).

I am currently implementing a feature that requires me to fetch information from a list. I am not quite sure on how to manage these information. I created a class that helps me manage theses information (User.cs). I have a getter in the class that currently searches for a value in a specific list. How should i handle the value ? Should i keep it in a member and refresh only when its subject to changes or should i refresh the value from the list each time i get it ?

private void doesUserHasActivities(){
      using(SPSite site = new SPSite("http://vmsharepoint2010/")){
          using(SPWeb web = site.openWeb("http://vmsharepoint2010/")){
              SPList list = web.list["Users"];
              SPListItem user;
              /*Information values is refresh each time its accessed, is this bad ?*/
              for(int i=0; i < list.items.length; i++){
                  user = list.item[i];
                  string accName = user["Acc_Name"];
                  if(accName == this.providedAccountname){//providedAccountname from a TextBox
                      //found the user i wanted into the list
                      //look if the list has data
                      bool hasActivities = user["Activities"] != null;
                  }
              }
          }
      }
}

Also, is there other ways to access specific data, in this case the activities list without looping through each rows trying to match the correct user and then looking up the values in the activities list ?

Can i store the row itself as a member for my meta data ? Will my reference still point to the row of the user list i want to if another user is added ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:16:46+00:00Added an answer on May 29, 2026 at 9:16 am

    You’ll need to learn CAML and perform a CAML query.

    Create an SPQuery object. Set it’s Query property to be what you need it to be, then use list.getItems(SPQuery query) to get just the items that match your query.

    You can figure out the CAML for it yourself; you’ll need to learn it if you want to deal with SharePoint code at all. There is lots of information on basic syntax, and tools for helping auto-generate it based on more user friendly syntax.

    The items won’t update dynamically when items are added to the list or updated in the list; you will need to re-run the query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few questions about ssis transction isolation levels. consider a scenario:I have an
I'm currently looking into C# Generics, and I have a few questions. 1) In
I want to have a generic function for a few types such as long,
i have few confusion regarding ORM(Object Relational Mapping) i am thinking about to use
I have few basic questions on session management in GWTP. Now, we create a
I have few basic questions on session management in GWTP. Client : GWTP, Server
I have made a generic handler (.ashx) to fetch some database values using jquery
we have quite a few projects that use the same codebase (backend code). Just
I'm starting to jump in to WP7 development and I have a few questions.
I have a generic interface, and a few classes implement it. then from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.