Re: C# and System.Data.SqlClient.SqlException
- From: "Brad Covelle" <bcovelle@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Nov 2005 16:51:30 -0500
If you are running the code under your username, and you don't have the same
rights as the user who is configured to run the SharePoint App Pool, you
won't have rights to do this. Try running it as an admin just to see what
happens or impersonating the app pool account in your code.
--
Brad Covelle
NuSoft Solutions
bcovelle@xxxxxxxxxxxxxxxxxxx
http://blogs.sagestone.net/bcovell
"mwg" <Maury.Gallaher@xxxxxxxxx> wrote in message
news:1131662454.254827.55280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am trying to write a basic c# windows application in visual studio. I
> am basing this code on the Sharepoint Products & Technologies Resource
> Kit.
>
> When I execute this code:
>
> Uri url = new Uri("http://spsservername");
> TopologyManager topology = new TopologyManager();
> PortalSite portal = topology.PortalSites[url];
>
> I get this error (clipped from QuickWatch when I inspect
> "topology.PortalSites[url]"):
>
> - topology.PortalSites[url] {System.Data.SqlClient.SqlException}
> System.Data.SqlClient.SqlException
> + System.SystemException {@"Login failed for user
> 'DOMAIN\username'."} System.SystemException
> + _errors {System.Data.SqlClient.SqlErrorCollection}
> System.Data.SqlClient.SqlErrorCollection
> Class 14 byte
> + Errors {System.Data.SqlClient.SqlErrorCollection}
> System.Data.SqlClient.SqlErrorCollection
> LineNumber 0 int
> Message @"Login failed for user 'DOMAIN\username'." string
> Number 18456 int
> Procedure "" string
> Server "sqlservername" string
> Source ".Net SqlClient Data Provider" string
> State 1 byte
>
> Any suggestions for where to look for an explanation?
>
> Here are some other factors:
> I am an administrator on the SPS server, but I don't have access rights
> to the SQL server with my account. The DOMAIN\username above is my
> personal login name, not the domain account used on the portal's
> application pool?
>
> Why isn't portal using the correct domain account? I can write web
> parts without any problems and access the portal without problems.
>
> Thanks in advance.
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: sites under area
- Next by Date: Re: how to add teamsites under area
- Previous by thread: C# and System.Data.SqlClient.SqlException
- Next by thread: Re: C# and System.Data.SqlClient.SqlException
- Index(es):
Relevant Pages
|