I am trying to connect SharePoint from C# windows forms application. I am able to connect to SharePoint but after getting connected to SharePoint site If I decide to connect to some other site and change the site address at clientcontext.Executequery() it gives error as "Incorrect username or password" though both of them are correct.
Asked
Active
Viewed 77 times
1 Answers
0
Make sure you init the clientcontext with target site, can't use it cross site.
using (var clientContext = new ClientContext("url1"))
{
clientContext.Credentials= new NetworkCredential("user", "password", "companydomain");

Lee
- 5,305
- 1
- 6
- 12