Questions tagged [spsite]

A member of the Microsoft.SharePoint namespace, SPSite represents a collection of sites in a Web application, including a top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site collections in the Web application.

A member of the Microsoft.SharePoint namespace, SPSite represents a collection of sites in a Web application, including a top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site collections in the Web application.

88 questions
14
votes
11 answers

SPSite - The Web application at
could not be found

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing…
FarOoOosa
  • 398
  • 1
  • 4
  • 13
1
vote
4 answers

SPSite URL value

Hello I am trying to fetch a list item and want to know if this is a good practice. SPSite spsite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spsite.RootWeb; SPList spList =…
variable
  • 4,473
  • 13
  • 75
  • 139
1
vote
1 answer

Can we put an SPWeb object into a SPSite object?

This is possible: using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication.Sites[0].Url)) Is this possible?: using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication.Sites[0].RootWeb.Url))
variable
  • 4,473
  • 13
  • 75
  • 139
0
votes
2 answers

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url)

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url) Which is good practice?
variable
  • 4,473
  • 13
  • 75
  • 139
0
votes
1 answer

The Web application at http://myWebsite.myCompany.nl could not be found

I have some custom code which is trying to get some item value from a list. First I wil try create a spsite object. But I got this error: Exception in GetConfigValue:PortalName, problem: at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri…
Ola
  • 4,405
  • 26
  • 129
  • 231
0
votes
2 answers

How to get SPSite in ASP.NET Web Site Project

I'm trying to use SP 2010 site from ASP.NET Web Site Project and when I create a new instance of SPSite I get this error: The Web application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing…
SDG
  • 3
  • 1
0
votes
1 answer

SPSite - exception Microsoft.SharePoint.SPSecurity.GetRolesForUser

I am trying to open site(FBA enabled with custommembership & customroleprovider) through module/httpmodule. It is throwing error System.NullReferenceException: Object reference not set to an instance of an object. at …
buddy
  • 1
0
votes
1 answer

how to get spsite title only

Right now my code gets the URL from my SPSite but I only want to get the Title var url = portalUrl.Text; if (SPSite.Exists(new Uri(url))) { using (SPSite oSiteCollection = new SPSite(url)) { SPSiteCollection collWebsite =…
Batistuta
  • 718
  • 1
  • 11
  • 38