I have system administrator role in Dynamics 365 org. I am able to login to the Dynamics portal but not able to access through code.
Can you please debug code and let us know what error you are getting?
ClientCredentials mycredentials = new ClientCredentials(); mycredentials.UserName.UserName = "..."; mycredentials.UserName.Password = "..."; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; OrganizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri("..."), null, mycredentials, null); if (OrganizationService != null) {};