Wiki Link: [discussion:4315]
Specifying Credentials 

Jan 1 2011 at 6:39 PM
LINQ to SharePoint DSL Extension is awesome.
Is there a way to set the credentials (ex. dc.Credentials = xx) when using LINQ To SharePoint?

Coordinator
Feb 3 2011 at 2:30 PM
Hi,

Sorry for the latency of this answer. First answer: no, there isn't a Credentials property like in the Client API, and it's a pity !
A solution to do that is to use a new credential context with the famous SPSecurity.RunWithElevatePrivilege method (called with a user token).
But, in fact this technical doesn't work too...

The solution is there, and the explanations are very good:
http://blogs.msdn.com/b/sowmyancs/archive/2010/09/19/linq-to-sharepoint-and-runwithelevatedprivileges.aspx

But be careful, changing the current httpcontext in an application is not without risk...

Good luck,

Olivier


jjj wrote:
LINQ to SharePoint DSL Extension is awesome.
Is there a way to set the credentials (ex. dc.Credentials = xx) when using LINQ To SharePoint?



Updating...
Page view tracker