0

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.

Krishna
  • 23
  • 4

1 Answers1

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