title: Retrieve List Items from a different Site Collection in SharePoint 2010
body: <p>I am having issues with retrieving list items from a different site collection. I don't have issues when trying to recieve list items from within my current site collection. For example, <a href="http://myintranet.com/Departments/IT" rel="nofollow">http://myintranet.com/Departments/IT</a> works. But <a href="http://myintranet.com/sites/Departments/IT" rel="nofollow">http://myintranet.com/sites/Departments/IT</a> returns an error.</p>
  
  <pre><code>if (!String.IsNullOrEmpty(SiteName) &amp;&amp; !String.IsNullOrEmpty(SPContext.Current.Web.Url))
      {
        SPSecurity.RunWithElevatedPrivileges(delegate()
        {
          using (SPSite intranetSite = new SPSite(SPContext.Current.Web.Url))
          {
            using (SPWeb currentWeb = intranetSite.AllWebs["/sites/projects/Physics"])
            {
              SPList postList = currentWeb.Lists.TryGetList("Issues");                
  
              if (postList != null)
              {
                IssueList.DataSource = postList.Items.GetDataTable();
  
                IssueList.DataBind();
              }
            }
          } 
  
        });
      }
  </code></pre>
  
  <p>I haven't used any different code to what I normally do when trying to recieve list items. The only difference is that this time I getting list items from another site collection.</p>
  
  <p>Thanks for any help!</p>